Add ability to set arbitrary arguments in a renderer process (#11850)
This commit is contained in:
parent
66b57858b8
commit
b3234f634b
6 changed files with 57 additions and 0 deletions
|
@ -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) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue