New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 638401 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Unable to disable javascript on linux via command line

Reported by tim.c.qu...@gmail.com, Aug 16 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.75 Safari/537.36

Steps to reproduce the problem:
1. Launch chrome using % google-chrome-beta --disable-javascript <url>
2. Javascript is still enabled for <url> loaded
3. 

What is the expected behavior?
JavaScript should be disabled for loaded web page in the same way that chrome stable operates.

What went wrong?
JavaScript is still enabled.

Did this work before? N/A 

Chrome version: 52.0.2743.75  Channel: beta
OS Version: openSUSE 13.2
Flash Version: Shockwave Flash 22.0 r0
 
Cc: rnimmagadda@chromium.org
Labels: Needs-Feedback
Unable to repro this issue on Ubuntu Trusty (14.04) for Google Chrome Beta Version - 53.0.2785.57

Screen-recording is attached.

@tim.c.quinn: Could you please re-test the same on Chrome Latest Beta Version - 53.0.2785.57 and let us know your observations.

Also, let us know if the procedure followed to repro this issue is appropriate is not?

Thank you.
638401.ogv
1.4 MB View Download
I've updated to: Google Chrome 53.0.2785.57 beta

Still an issue.

My test case:
1) Create an html file called foo.html:
~~~
<html>
  if JS enabled, you have alert saying hi.
  <script>
    alert('hi')
  </script>
</html>
~~
2) Run the following command: % google-chrome-beta --disable-javascript ~/_t/foo.html

In my case, the parameter comes in and shows in chrome://version but the JS alert still shows. Also testing with Facebook still has JS enabled. 

I would expect that --disable-javascript would disable JS on the first page loaded as a minimum and ideally disable JS globally for that browser session.
I'm not sure which documentation you have found that indicates "disable-javascript" is a supported command line feature. Can you please provide a reference to that?

I've searched the code and do not find "disable-javascript" as an applicable command line switch and that is why you see it do nothing.
I could not find any formal documentation but I have seen it used for chrome stable with several mentions on the internet. Maybe its an undocumented feature? Definitely a good feature to have even if its not official. My only alternative is to use another browser :(
Confirmed that it was removed from Chromium code base

It existed at one point in time here: https://chromium.googlesource.com/chromium/chromium/+/df261d32079bc4e1160c36200657eed26fad5961/content/public/common/content_switches.cc

But presently content_switches.cc does not have the option any longer.

Its discussed here: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-reviews/MrgRsAcapYQ

Too bad. I am surprised that this was not left in the command line options as it has its uses. I am going to have to switch to another browser for this usecase.

For those interested in this functionality in a browser. Tor Browser does not run JavaScript by default so that's my current go-to for defaulted no JS browsing.


FYI, I discussed this on ServerFault here: http://superuser.com/questions/1114318/disable-javascript-in-chrome-beta-via-cli-on-linux/1114739#1114739

Please feel free to close this ticket and sorry about the noise.

- Tim
Labels: -Needs-Feedback
Status: WontFix (was: Unconfirmed)
Closing this issue as per the comment #6

Sign in to add a comment