`<noscript>` attributes aren't copied to the replacement `<span>`

This issue has been tracked since 2022-03-28.

Heyah! Thanks for working on the extension.

Some questions:

  1. Why are noscript tag attributes stripped?
  2. Why convert <noscript> to <span>?

It's a bit too destructive since I just ran into a fairly common scenario where I need to keep the attributes, especially the classes.


Simple index.html file:

Output with NoScript:

Output with JS disabled at the browser level (same results in FF and Chrome):

I couldn't find any mention about these behaviors in the issue tracker, and FAQ. I only got to pin it down to the extension after reading this: https://css-tricks.com/forums/topic/noscript-tag-implementation-has-changed/.

sekunho wrote this answer on 2022-03-28

Seems to be the same thing with this (dpacassi/disable-javascript#101) extension as well.

hackademix wrote this answer on 2022-03-28

The problem is that the only way a webextension can disable JavaScript is by using Content Security Policies.
CSP don't affect <noscript> elements rendering, which are therefore kept hidden by the browser through a high priority CSS which cannot be overridden.
The most I can do is copying the attributes to the replacement <span>.

sekunho wrote this answer on 2022-03-28

Ah, so that's why! Thanks for the explanation. I suppose it won't be a big deal at all if ever the attributes can be copied over.

More Details About Repo
Owner Name hackademix
Repo Name noscript
Full Name hackademix/noscript
Language JavaScript
Created Date 2018-06-30
Updated Date 2022-12-03
Star Count 573
Watcher Count 21
Fork Count 79
Issue Count 151


Issue Title Created Date Updated Date