-
Notifications
You must be signed in to change notification settings - Fork 523
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
FF 117.0b4: CSP blocks live example with img.src="data:image/svg+xml,base64,"+...
#9463
Comments
img.src="data:image/svg+xml,base64,"+...
Thanks for reporting @kkm000 - we'll take a look, but you're right about the CSP issue. I wonder if there's a better way to write the example that doesn't B64 encode the images like this. |
@bsmth, Thank you for your quick response! Yes, I vaguely remember that the OTOH, Web programming sometimes looks less than straightforward IRL. I've seen comments like “Don't use X here, it breaks Safari under iOS on small screens.” That's one of these random moments of relief when I feel happy that I'm not writing public Web pages, only simple ones for internal visualisation. But then, I immediately recalled, w.r.t. my own craft, comments in C++ code like “// Don't yank these 'typedef's! They unbreak compilation with MSVC prior to v17.” When you have experience, you know what specs are borked and know the tricks to work around the borkage. This is why I didn't dare trying to fix (or, rather, “fix”) the example. :-) |
The same issue is breaking the example code on this page: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL - the images do not appear. In this case it is pretty much impossible to avoid using Tested with both Firefox and Chrome. |
OK thanks for reporting, so either way we need a CSP update ( |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
What specific section or headline is this issue about?
Color scheme inheritance
What information was incorrect, unhelpful, or incomplete?
The example's in-page JS creates an SVG image with three colored circles and assigns it to
img.src
property as adata:
URI; specifically, in this line of the example:The image fails to load. Instead, the output box shows alt-text only:
An error is logged in the browser's log:
Addendum (23-08-11): MS Edge's (v115.0.1901.200) error message is more specific:
The full log of warnings and errors; all but the message above are warnings:
I'm a scientist/SWE mainly familiar with HPC C++, with little UI experience, barely able to code a bit of simple HTML and CSS. Fixing this error is way above my pay grade, sorry.
What did you expect to see?
Three colored circles.
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
Browser: Firefox 117.0b3 (64-bit), beta channel, on Windows 11 v10.0.22621.1992.
MDN metadata
Page report details
en-us/web/css/@media/prefers-color-scheme
The text was updated successfully, but these errors were encountered: