Add disable-javascript command-line flag to match documentation (issue #1848)

This commit is contained in:
Marshall Greenblatt 2018-09-25 14:01:59 +02:00
parent b9c10cb46e
commit 64cd460c73
3 changed files with 6 additions and 0 deletions

View File

@ -49,6 +49,8 @@ void SetDefaultPrefs(content::WebPreferences& web) {
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
web.javascript_enabled =
!command_line->HasSwitch(switches::kDisableJavascript);
web.allow_scripts_to_close_windows =
!command_line->HasSwitch(switches::kDisableJavascriptCloseWindows);
web.javascript_can_access_clipboard =

View File

@ -29,6 +29,9 @@ const char kUncaughtExceptionStackSize[] = "uncaught-exception-stack-size";
// Default encoding.
const char kDefaultEncoding[] = "default-encoding";
// Disable JavaScript.
const char kDisableJavascript[] = "disable-javascript";
// Disable closing of windows via JavaScript.
const char kDisableJavascriptCloseWindows[] =
"disable-javascript-close-windows";

View File

@ -23,6 +23,7 @@ extern const char kLocalesDirPath[];
extern const char kDisablePackLoading[];
extern const char kUncaughtExceptionStackSize[];
extern const char kDefaultEncoding[];
extern const char kDisableJavascript[];
extern const char kDisableJavascriptCloseWindows[];
extern const char kDisableJavascriptAccessClipboard[];
extern const char kDisableJavascriptDomPaste[];