--disable-javascript no longer works?

201 views
Skip to first unread message

Brian Kuhn

unread,
Jun 27, 2012, 10:54:26 AM6/27/12
to chromium...@chromium.org
It appears Chrome no longer supports the --disable-javascript flag.

Does anyone know when or why this happened?  I believe it worked in Chrome 14.  Is there another flag I can use for the same effect?

Thanks,
     Brian

Joao da Silva

unread,
Jun 27, 2012, 11:14:57 AM6/27/12
to bnk...@gmail.com, j...@chromium.org, chromium...@chromium.org
@John: I'm not sure but this might have been introduced by http://crrev.com/81851 about a year ago. On a recent build I've verified that the --disable-javascript flag isn't forwarded from the browser to the renderer processes.

@Brian: as a user you can disable javascript for all sites or for selected sites only on the content settings ( chrome://chrome/settings/content). As an administrator you can use group policy to disable javascript or enforce content settings that do that (see http://www.chromium.org/administrators).

- Joao

--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

Brian Kuhn

unread,
Jun 27, 2012, 11:20:38 AM6/27/12
to Joao da Silva, j...@chromium.org, chromium...@chromium.org
Thanks Joao.  

I was using this flag for automated testing.  The admin option sounds like it might work; I'll look into that.

Should I file a bug to have the flag fixed?

-Brian

Joao da Silva

unread,
Jun 27, 2012, 11:27:47 AM6/27/12
to Brian Kuhn, j...@chromium.org, chromium...@chromium.org
On Wed, Jun 27, 2012 at 5:20 PM, Brian Kuhn <bnk...@gmail.com> wrote:
Thanks Joao.  

I was using this flag for automated testing.  The admin option sounds like it might work; I'll look into that.


For testing you can also directly edit the Preferences file inside the Chrome profile. The path to the profile dir is shown in about:version. The Preferences file is a JSON file (edit with care :-) ), and to disable javascript you can place this there:

{
  ...
  "profile": {
    "default_content_settings": {
      "javascript": 2
    }
  }
}

Look out for an existing "profile" entry, and for trailing commas. Otherwise this should work. You can also use the --user-data-dir switch to use another directory as the profile directory.

Should I file a bug to have the flag fixed?

Most likely, yes :-) I'd wait to have John's take on this, I might be missing something.

- Joao

John Abd-El-Malek

unread,
Jun 27, 2012, 11:42:32 AM6/27/12
to Joao da Silva, bnk...@gmail.com, chromium...@chromium.org
On Wed, Jun 27, 2012 at 8:14 AM, Joao da Silva <joaod...@chromium.org> wrote:
@John: I'm not sure but this might have been introduced by http://crrev.com/81851 about a year ago. On a recent build I've verified that the --disable-javascript flag isn't forwarded from the browser to the renderer processes.

The flag was never passed to the process, before or after that change. It's used by WebContentsImpl to pass this along in the WebPreferences.

If this stopped working, I suggest figuring out the revision range where it failed.
Reply all
Reply to author
Forward
0 new messages