Add option to override webview security

This commit is contained in:
Hari Krishna Reddy Juturu 2017-05-06 22:10:42 -07:00
parent b4a8ed01f1
commit 94d054cf11
7 changed files with 64 additions and 2 deletions

View file

@ -101,6 +101,13 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
if (web_preferences.GetBoolean(options::kNodeIntegrationInWorker, &b) && b)
command_line->AppendSwitch(switches::kNodeIntegrationInWorker);
// Check if webview tag creation is overriden.
bool enable_webview_override = false;
web_preferences.GetBoolean(options::kEnableWebViewOverride,
&enable_webview_override);
command_line->AppendSwitchASCII(switches::kEnableWebViewOverride,
enable_webview_override ? "true" : "false");
// 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.