]> khamidou — GitHub mirrors - electron.git/commitdiff
Don't pollute process.argv of browser process.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 30 Jan 2014 13:17:16 +0000 (21:17 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 30 Jan 2014 13:20:02 +0000 (21:20 +0800)
app/atom_main_delegate.cc
browser/default_app/main.js

index 1f304926db99f48e3fb36383e595cb852c8777aa..816df2916b13a8bf192b62cdc0a448e47e9d5808 100644 (file)
@@ -66,7 +66,7 @@ void AtomMainDelegate::PreSandboxStartup() {
   command_line->AppendSwitch(switches::kDisableAcceleratedCompositing);
 
   // Add a flag to mark the end of switches added by atom-shell.
-  command_line->AppendSwitch("no-more-switches");
+  command_line->AppendSwitch("no-more-atom-shell-switches");
 }
 
 void AtomMainDelegate::InitializeResourceBundle() {
index 2aff83e30b0d91f93e3015af198e0afa3d1da12f..acf1a38976df55bede59689bc82fda0717dad39a 100644 (file)
@@ -1,5 +1,4 @@
 var app = require('app');
-var dialog = require('dialog');
 var path = require('path');
 var optimist = require('optimist');
 
@@ -9,6 +8,10 @@ app.on('window-all-closed', function() {
     app.quit();
 });
 
+// Pick out switches appended by atom-shell.
+var endMark = process.argv.indexOf('--no-more-atom-shell-switches');
+process.execArgv = process.argv.splice(1, endMark)
+
 var argv = optimist(process.argv.slice(1)).argv;
 
 // Start the specified app if there is one specified in command line, otherwise