Giter Site home page Giter Site logo

Comments (5)

dracos avatar dracos commented on July 29, 2024

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.

gr8bit avatar gr8bit commented on July 29, 2024

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.

dracos avatar dracos commented on July 29, 2024

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.

gr8bit avatar gr8bit commented on July 29, 2024

Oh, I overlooked that the source is actually in loadCSS, my bad. Did you (or Firefox) solve it in the meantime?

from loadcss.

dracos avatar dracos commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.