From dd804d7432a8d5f95888c376306f4961d1afd808 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 29 May 2016 10:34:53 +0900 Subject: [PATCH] Enable specifying custom command line switches --- atom/browser/web_contents_preferences.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index ef9fc4d..a32e23d 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -150,6 +150,16 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches( command_line->AppendSwitch(switches::kScrollBounce); #endif + // Custom command line switches. + const base::ListValue* args; + if (web_preferences.GetList("commandLineSwitches", &args)) { + for (size_t i = 0; i < args->GetSize(); ++i) { + std::string arg; + if (args->GetString(i, &arg) && !arg.empty()) + command_line->AppendSwitch(arg); + } + } + // Enable blink features. std::string blink_features; if (web_preferences.GetString(options::kBlinkFeatures, &blink_features)) -- 2.7.4