Page 1 of 1

JavaScript toggle (on/off)

Posted: Mon Feb 05, 2018 4:17 pm
by jb
Hi,
Can I turn On/Off JavaScript engine to let web sites know about it so that some of them by being aware of it would stream JavaScript-free alternate content ? Would it be possible to toggle it per all web sites and per individual web site ?

This is of course different than disabling JavaScript processing AFTER the web site already streamed the content, as it is now if I understand it.

Re: JavaScript toggle (on/off)

Posted: Mon Feb 05, 2018 4:37 pm
by barbaz
"JavaScript-free alternate content" is served as part of the page, inside <noscript> tags. NoScript tries to display them when scripts are blocked.
jb wrote:This is of course different than disabling JavaScript processing AFTER the web site already streamed the content, as it is now if I understand it.
What you want is not technically possible on NoScript end, sorry. The closest you'll get is, a site either A) puts a meta refresh inside a <noscript> tag, or B) includes a <script> tag that redirects you to the JS version of the page.

Re: JavaScript toggle (on/off)

Posted: Mon Feb 05, 2018 5:18 pm
by jb
Hi,
I was looking at this add-on and its description/user comments as below.

Firefox
Tools - Add-ons - Get Add-ons
search for "no script"

JavaScript Toggle On and Off (Web Extemsion) December 4, 2017
https://add0n.com/javascript-toggler.html wrote: ...
In Firefox browser, there is a flag called javascript.enabled. Does this extension alter this flag to disable the browser's JavaScript engine?

There are two versions of this extension. In the WebExtension compatible version, there is no interaction with the internal preferences (there is actually no way to interact with them!). To block JavaScript engine, the extension manipulates policy rules of the top request so that no JS code can be executed (it will violate the policy rule). Note that turning javascript.enabled off from the "about:config" may result in a different visual appearance compared to when this extension blocks the JS execution. In the former method, website is aware that there is no JS access and hence it might redirect user to the HTML only version of the page, however in the latter method, there is no signal for the server to know that JS is not supported and hence normal page is loaded but JS code is not being executed.
https://addons.mozilla.org/en-US/firefox/addon/javascript-toggler/reviews/980056/ wrote: The addon is good but, for Mozilla's fault, the addons have lost power on what they can do (not only this one).
As such, this addon does not enable/disable the javascript flag (about:config, javascript.enable=false) anymore, on the contrary it only BLOCK the execution, and there is a chasm between TOGGLING and BLOCKING.

Toggling JS off means that website can see you don't have JS and it doesn't waste time sending scripts. It also means that the website can adapt itself for browsers without JS so that you can have it working partially or even 100% even without JS.

On the contrary, blocking means the website knows nothing about your browser blocking JS, so:
- The band/time is wasted because it sends the JS script anyway
- the website doesn't work well or at all (try google image: empty page. With a real toggler it was 100% useable without JS).

Result: None of the JS toggler for FF 57+ can really act as a toggler and we have the above problems.

The problem is not of this extension or is a developer fault, the problem is Mozilla Firefox way (and Google Chrome is even worse).

Re: JavaScript toggle (on/off)

Posted: Mon Feb 05, 2018 7:57 pm
by barbaz
Those quotes are talking about the lack of <noscript> tags. NoScript 10 works around that problem.