dpacassi / disable-javascript

Adds the ability to disable JavaScript on specific sites.
MIT License
271 stars 34 forks source link

<noscript> tag content is not rendered #79

Open aethernet opened 3 years ago

aethernet commented 3 years ago

Hi

Thanks for this nice tool.

I planned to use your extension to test behaviour websites without js for accessibility purposes. But the content of noscript tags aren't rendered to the page.

Is it a feature or a bug? If it's a feature, a way to disable it would be welcome.

Have a wonderful day!

dpacassi commented 3 years ago

Hi @aethernet

<noscript> Tags should be rendered correctly if JS is disabled, it was actually the first reported issue: #1 Can you please check this small page: https://pacassi.ch/test.html If JS is disabled, you should see a You don't have javascript enabled. paragraph.

If the behavior works correctly on the above posted page but not on yours, I would need to access your page (or a small proof of concept) in order to reproduce the bug. If the web extension doesn't even work in the aboge posted page, I'll need more information such as:

Thanks for collaborating! :)

juliemoynat commented 3 years ago

Hi,

There is a problem when there are several noscript elements in a page. I've made a CodePen with that code:

<noscript>test 1</noscript>
<noscript>test 2</noscript>
<p>Lorem ipsum paragraph</p>
<noscript>test 3</noscript>

When JavaScript is disabled thanks to the plugin, I can only see:

test 1 Lorem ipsum paragraph test 3

Here is the debug link: https://cdpn.io/juliemoynat/debug/NWRdvQe/xnMabmzPbepr (I think it's a temporary link and I don't know how long it lasts - the original Pen is here: https://codepen.io/juliemoynat/pen/NWRdvQe).

I don't know why but some noscript elements are actually not displayed.

dpacassi commented 3 years ago

I see the bug now! I've updated my test file on https://pacassi.ch/test.html and can reproduce the bug. The section to convert <noscript> tags to <div> tags is in this file: https://github.com/dpacassi/disable-javascript/blob/master/background/content.js

If anyone can fix the issue, I'd gladly accept any pull request! Not sure when I'll have the time to have a look at it.

searosin commented 2 years ago

Hi,

Here is my pull request, which fixes the issue: #100