Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No CORS support #2

Closed
aandroyd opened this issue Oct 7, 2019 · 1 comment
Closed

No CORS support #2

aandroyd opened this issue Oct 7, 2019 · 1 comment

Comments

@aandroyd
Copy link

aandroyd commented Oct 7, 2019

If the stylesheet is loaded with @import from another domain, Chrome 64+ hits a CORS error:
Uncaught DOMException: Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules...

@samthor
Copy link
Owner

samthor commented Feb 14, 2020

I've just published 0.2.0 which makes this work. If we get a SecurityError reading/modifying imported CSS, we go and fetch it.

It's not perfect:

  • it will create memory leaks (as it uses URL.createObjectURL and does not revoke them)
  • it means loading CSS on page startup isn't synchronous (you might see a flash as CSS arrives later)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants