From 421bf71b98ebdcc87acc85321435f8de1b8e306e Mon Sep 17 00:00:00 2001 From: Hari Juturu Date: Tue, 13 Jun 2017 18:45:24 -0700 Subject: [PATCH] Adding no-sandbox to non sandbox webcontents --- atom/browser/web_contents_preferences.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 6c706199fb9f..e602ddcf88d9 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -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);