Add nodeIntegrationInWorker option

This commit is contained in:
Cheng Zhao 2017-03-15 18:51:21 +09:00
parent e496e18f6e
commit a49af26e39
4 changed files with 20 additions and 2 deletions

View file

@ -97,6 +97,10 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
command_line->AppendSwitchASCII(switches::kNodeIntegration,
node_integration ? "true" : "false");
// Whether to enable node integration in Worker.
if (web_preferences.GetBoolean(options::kNodeIntegrationInWorker, &b) && b)
command_line->AppendSwitch(switches::kNodeIntegrationInWorker);
// 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.