-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Firefox error: "Uncaught DOMException: CSSStyleSheet.cssRules getter: Not allowed to access cross-origin stylesheet" #429
Comments
Hi @JoshuaKGoldberg thanks so much for the report and big thanks for the links, that explains a lot. I've made a comment on https://bugzilla.mozilla.org/show_bug.cgi?id=1393022 so hopefully we can get an answer from the Firefox team soon, but I agree for now it would be nice if |
@JoshuaKGoldberg I have this ready but have been having a hard time replicating/testing the exact error. Do you mind giving me the CSS content you have that's causing the problem? I tried replicating with the following but didn't see an error: <style id="crossOriginImport">
@import url("https://www.codecademy.com/webpack/5.2b8e4552d70cf8bdea04.chunk.css");
</style> |
We haven't gotten around to reproducing this locally, but from knowing the call stack here are the repro steps:
You need to be a Pro subscriber to do this so if you want, email me at Sorry I don't have anything more for you! |
@JoshuaKGoldberg I sent you an email but haven't heard back |
Hey, sorry - I'm on vacation and not checking my work email often 😄. Responding now! |
Replying here to keep information available: So, the node on https://discourse.mozilla.org/t/accessing-some-fonts-css-style-sheet-via-stylesheet-throws-securityerror/38717 that causes the error is <link rel="stylesheet" href="https://www.apple.com/wss/fonts?families=SF+Pro,v1" type="text/css"></link> When accessing it via Interestingly, when I try to put that resource on my local test examples I get a completely different error, on both Chrome and Firefox: The other hard part is that <style id="crossOriginImport">
@import url("https://www.apple.com/wss/fonts?families=SF+Pro,v1");
</style> For now going to ship the |
Some browers do not allow script access to cross-origin sheets. Details: #429
Some browsers do not allow script access to cross-origin sheets. Details: #429
The fix for this has been published in v2.14.1, please let me know if you run into any other issues. Thanks so much for the debugging help! |
Amazing, thanks so much! |
Some browsers do not allow script access to cross-origin sheets. Details: MatthewHerbst/react-to-print#429
Recreating #278 but with a call stack:
252.4033dce2c049256b0fb3.chunk.js.txt
The specific line that's throwing the error is https://github.com/gregnb/react-to-print/blob/c224cf7f03c7fc44478cafd60fef2a822d97adca/src/index.tsx#L376
Root cause:
sheet.cssRules
is getting blocked by Firefox: https://discourse.mozilla.org/t/webextensions-porting-access-to-cross-origin-document-stylesheets-cssrules/18359 / https://discourse.mozilla.org/t/accessing-some-fonts-css-style-sheet-via-stylesheet-throws-securityerror/38717.I don't know how to work around this 😄 ... maybe log a warning and continue without the styles?
The text was updated successfully, but these errors were encountered: