noscript icon indicating copy to clipboard operation
noscript copied to clipboard

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

Open sekunho opened this issue 3 years ago • 3 comments

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.

Example

Simple index.html file: image

Output with NoScript: image

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

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 avatar Mar 28 '22 13:03 sekunho

Seems to be the same thing with this (https://github.com/dpacassi/disable-javascript/issues/101) extension as well.

sekunho avatar Mar 28 '22 13:03 sekunho

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>.

hackademix avatar Mar 28 '22 14:03 hackademix

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.

sekunho avatar Mar 28 '22 14:03 sekunho