Enable specifying custom command line switches
authorCheng Zhao <zcbenz@gmail.com>
Sun, 29 May 2016 01:34:53 +0000 (10:34 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 29 May 2016 01:34:53 +0000 (10:34 +0900)
atom/browser/web_contents_preferences.cc

index ef9fc4df0b8c0da134eb100f2127fb8552c0fde8..a32e23de68f563625396e0081bc373d4a43408d7 100644 (file)
@@ -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))