Add ability to set arbitrary arguments in a renderer process (#11850)

This commit is contained in:
Samuel Attard 2018-02-13 04:54:31 +11:00 committed by Charles Kerr
parent 66b57858b8
commit b3234f634b
6 changed files with 57 additions and 0 deletions

View file

@ -136,6 +136,17 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
LOG(ERROR) << "preload url must be file:// protocol.";
}
// Custom args for renderer process
base::Value* customArgs;
if ((web_preferences.Get(options::kCustomArgs, &customArgs))
&& (customArgs->is_list())) {
for (const base::Value& customArg : customArgs->GetList()) {
if (customArg.is_string()) {
command_line->AppendArg(customArg.GetString());
}
}
}
// Run Electron APIs and preload script in isolated world
bool isolated;
if (web_preferences.GetBoolean(options::kContextIsolation, &isolated) &&