diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index ba3be9592d79..26ff3d703381 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -111,12 +111,12 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches( if (IsSandboxed(web_contents)) { // pass `--enable-sandbox` to the renderer so it won't have any node.js // integration. - command_line->AppendSwitch(switches::kEnableSandbox); - } - else { + command_line->AppendSwitch(switches::kEnableSandbox); + } else { // Disable renderer sandbox for most of node's functions. command_line->AppendSwitch(::switches::kNoSandbox); } + if (web_preferences.GetBoolean("nativeWindowOpen", &b) && b) command_line->AppendSwitch(switches::kNativeWindowOpen);