Comments (5)
Hmm, https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute actually says:
Since the specified value gets converted into a string, specifying null doesn't necessarily do what you expect. Instead of removing the attribute or setting its value to be null, it instead sets the attribute's value to the string "null". If you wish to remove an attribute, call removeAttribute().
So perhaps setting it to null
is not the right thing to do, and the bug is here, not Firefox.
from loadcss.
Your CSP seems to forbid the execution of inlined javascript. Therefore you won't be able to execute ANY javascript that's in the HTML of the page, be it between <script> tags or in an element's attribute (e.g. "onload").
from loadcss.
You can run inline javascript within a <script> tag if you provide a nonce. Which is what I was doing, which is what led to me opening this ticket.
from loadcss.
Oh, I overlooked that the source is actually in loadCSS, my bad. Did you (or Firefox) solve it in the meantime?
from loadcss.
No, I still get the CSP error in Firefox running that line (you can see it on https://www.fixmystreet.com/ for example). I should probably switch to the removeAttribute thing I suggest here, I guess I thought it would get merged by now.
from loadcss.
Related Issues (20)
- FOUC on 'No Throttled' condition? HOT 2
- Polyfill has an issue in chrome
- Optionally preload without as attr?
- Don't rely on invalid media attributes to download? HOT 10
- standalone or via npm?
- element with id `global` prevents loadCSS execution
- Supports preload
- Cannot use inline 'onload' because of CSP HOT 6
- The plugin doesn't do anything to preload elements in Firefox HOT 1
- Cannot install version 3.0.0 because node version is hardcoded to 11.9.0 HOT 5
- Where has the cssrelpreload polyfill gone in 3.0.0? HOT 2
- Required node version HOT 5
- Export onloadCSS
- CSS is being loaded twice HOT 3
- loadCSS not helping with render-blocking content
- Why do I sometimes get a recommendation in google pagespeed 'Reduce unused CSS' ? HOT 1
- Wouldn't loading css asynchronously cause FOUC? HOT 1
- Calling loadCSS from a TypeScript Vite application throws Uncaught TypeError: Cannot read properties of undefined (reading 'createElement') at loadCSS (loadCSS.js:13:16)
- Help - loadCSS/Critical file load not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loadcss.