0

I am using this for async loading the CSS file:

<link rel="preload" href="style.css" as="style" onload="this.rel='stylesheet'">

, but the event doesn't bind in Firefox. In Chrome works fine and preload is changed to stylesheet. In FF stays the same.

I have tried with onload="console.log(90)"> and it binds in Chrome, but no in FF.

1 Answer 1

2

The preload specification is only an Editor's Draft. It isn't standard. It should be considered experimental and not for production use.

Firefox doesn't support it as standard (although you can turn it on in the browser's settings if you want to test its implementation).

Sign up to request clarification or add additional context in comments.

5 Comments

I know it doesn't support. If you check the code you will see, that it uses onload event to change it to stylesheet, but this onload event doesn't bind in FF. This is what I am asking.
@gdfgdfg — It doesn't support preload. So it doesn't load it. Since it never loads it, the onload event won't fire.
Ok, but why this works in Chrome ? Also, stackoverflow.com/a/46750893/5849229
Because Chrome does support preload! And the answer you link to says that it won't work in Firefox!
hm ok thanks. I was confused that it works on Chrome and forgot actually what onload means :) .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.