Merge pull request #9644 from electron/webview-sandbox

Enable sandbox on webview
This commit is contained in:
Kevin Sawicki 2017-06-28 10:10:25 -07:00 committed by GitHub
commit 2cd49f3036
14 changed files with 209 additions and 8 deletions

View file

@ -111,8 +111,11 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
// If the `sandbox` option was passed to the BrowserWindow's webPreferences,
// pass `--enable-sandbox` to the renderer so it won't have any node.js
// integration.
if (IsSandboxed(web_contents))
if (IsSandboxed(web_contents)) {
command_line->AppendSwitch(switches::kEnableSandbox);
} else if (!command_line->HasSwitch(switches::kEnableSandbox)) {
command_line->AppendSwitch(::switches::kNoSandbox);
}
if (web_preferences.GetBoolean("nativeWindowOpen", &b) && b)
command_line->AppendSwitch(switches::kNativeWindowOpen);