File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -27,17 +27,19 @@ const { getUNCHost, addUNCHostToAllowlist } = require('./vs/base/node/unc');
27
27
const product = require ( '../product.json' ) ;
28
28
const { app, protocol, crashReporter, Menu } = require ( 'electron' ) ;
29
29
30
- // Enable sandbox globally
31
- app . enableSandbox ( ) ;
32
-
33
30
// Enable portable support
34
31
const portable = bootstrapNode . configurePortable ( product ) ;
35
32
36
33
// Enable ASAR support
37
34
bootstrap . enableASARSupport ( ) ;
38
35
39
- // Set userData path before app 'ready' event
36
+ // Enable sandbox globally unless disabled via `--no-sandbox` argument
40
37
const args = parseCLIArgs ( ) ;
38
+ if ( args [ 'sandbox' ] ) {
39
+ app . enableSandbox ( ) ;
40
+ }
41
+
42
+ // Set userData path before app 'ready' event
41
43
const userDataPath = getUserDataPath ( args , product . nameShort ?? 'code-oss-dev' ) ;
42
44
if ( process . platform === 'win32' ) {
43
45
const userDataUNCHost = getUNCHost ( userDataPath ) ;
@@ -464,7 +466,13 @@ function parseCLIArgs() {
464
466
'locale' ,
465
467
'js-flags' ,
466
468
'crash-reporter-directory'
467
- ]
469
+ ] ,
470
+ default : {
471
+ 'sandbox' : true
472
+ } ,
473
+ alias : {
474
+ 'no-sandbox' : 'sandbox'
475
+ }
468
476
} ) ;
469
477
}
470
478
You can’t perform that action at this time.
0 commit comments