diff --git a/atom/renderer/atom_sandboxed_renderer_client.cc b/atom/renderer/atom_sandboxed_renderer_client.cc index 2768f072cd6e..aa4780fa15b8 100644 --- a/atom/renderer/atom_sandboxed_renderer_client.cc +++ b/atom/renderer/atom_sandboxed_renderer_client.cc @@ -80,6 +80,10 @@ v8::Local GetBinding(v8::Isolate* isolate, v8::Local key, return exports; } +base::CommandLine::StringVector GetArgv() { + return base::CommandLine::ForCurrentProcess()->argv(); +} + void InitializeBindings(v8::Local binding, v8::Local context) { auto isolate = context->GetIsolate(); @@ -87,6 +91,7 @@ void InitializeBindings(v8::Local binding, b.SetMethod("get", GetBinding); b.SetMethod("crash", AtomBindings::Crash); b.SetMethod("hang", AtomBindings::Hang); + b.SetMethod("getArgv", GetArgv); b.SetMethod("getProcessMemoryInfo", &AtomBindings::GetProcessMemoryInfo); b.SetMethod("getSystemMemoryInfo", &AtomBindings::GetSystemMemoryInfo); } diff --git a/lib/sandboxed_renderer/init.js b/lib/sandboxed_renderer/init.js index 1aec0bc0bfd2..119391e79462 100644 --- a/lib/sandboxed_renderer/init.js +++ b/lib/sandboxed_renderer/init.js @@ -41,6 +41,7 @@ preloadProcess.crash = () => binding.crash() preloadProcess.hang = () => binding.hang() preloadProcess.getProcessMemoryInfo = () => binding.getProcessMemoryInfo() preloadProcess.getSystemMemoryInfo = () => binding.getSystemMemoryInfo() +preloadProcess.argv = binding.getArgv() process.platform = preloadProcess.platform = electron.remote.process.platform process.execPath = preloadProcess.execPath = electron.remote.process.execPath process.on('exit', () => preloadProcess.emit('exit')) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index 927363150508..ab40331225a3 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1286,7 +1286,7 @@ describe('BrowserWindow module', function () { }) }) - it('enable-mixed-sandbox', (done) => { + it('adds --enable-sandbox to render processes created with sandbox: true', (done) => { this.timeout(120000) let state = 'none'