Skip to content

Commit

Permalink
chore: re-enable devtools renderer sandbox (#16864)
Browse files Browse the repository at this point in the history
* chore: re-enable devtools renderer sandbox

* chore: enable sandbox for chrome extension background script host renderers
  • Loading branch information
miniak authored and deepak1556 committed Feb 15, 2019
1 parent 2498e8d commit 975a035
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
9 changes: 0 additions & 9 deletions atom/browser/atom_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
#include "services/device/public/cpp/geolocation/location_provider.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
#include "services/service_manager/sandbox/switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "v8/include/v8.h"
Expand Down Expand Up @@ -496,15 +495,7 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches(

content::WebContents* web_contents = GetWebContentsFromProcessID(process_id);
if (web_contents) {
// devtools processes must be launched unsandboxed in order for the remote
// API to work in devtools extensions. This is due to the fact that the
// remote API assumes that it will only be used from the main frame, but
// devtools extensions are loaded from an iframe.
// It would be possible to sandbox devtools extensions processes by default
// if we made the remote API work with multiple frames.
if (web_contents->GetVisibleURL().SchemeIs("chrome-devtools")) {
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
command_line->AppendSwitch(::switches::kNoZygote);
command_line->AppendSwitch(switches::kDisableRemoteModule);
}
auto* web_preferences = WebContentsPreferences::From(web_contents);
Expand Down
1 change: 1 addition & 0 deletions lib/browser/chrome-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const startBackgroundPages = function (manifest) {
partition: 'persist:__chrome_extension',
isBackgroundPage: true,
commandLineSwitches: ['--background-page'],
sandbox: true,
enableRemoteModule: false
})
backgroundPages[manifest.extensionId] = { html: html, webContents: contents, name: name }
Expand Down

0 comments on commit 975a035

Please sign in to comment.