File tree Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Expand file tree Collapse file tree 4 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,10 @@ export default {
139139 alias : 'n' ,
140140 default : false ,
141141 } ,
142+ sandbox : {
143+ type : 'boolean' ,
144+ default : true ,
145+ } ,
142146 } ,
143147
144148 CHROME_LAUNCH_ARGS : [
Original file line number Diff line number Diff line change @@ -54,21 +54,25 @@ const getDefaultOptions = (): Options => {
5454} ;
5555
5656const normalizeSandboxOption = (
57- noSandbox : boolean | undefined ,
57+ options : CLIOptions ,
5858 logger : LoggerFunction ,
5959) : Partial < Options > => {
6060 let sandboxDisabled = false ;
61- if ( noSandbox ) {
62- if ( os . platform ( ) !== 'linux' ) {
63- logger . warn (
64- 'Disabling sandbox is only relevant on Linux platforms, request declined!' ,
65- ) ;
66- } else {
67- sandboxDisabled = true ;
68- }
61+ if ( options . noSandbox === true ) {
62+ sandboxDisabled = true ;
63+ }
64+ if ( options . sandbox === false ) {
65+ sandboxDisabled = true ;
66+ }
67+ if ( sandboxDisabled && os . platform ( ) !== 'linux' ) {
68+ logger . warn (
69+ 'Disabling sandbox is only relevant on Linux platforms, request declined!' ,
70+ ) ;
71+ sandboxDisabled = false ;
6972 }
7073 return {
7174 noSandbox : sandboxDisabled ,
75+ sandbox : ! sandboxDisabled ,
7276 } ;
7377} ;
7478
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ async function generateImages(
6363 options ,
6464 logger ,
6565 ) ,
66- ...flags . normalizeSandboxOption ( options . noSandbox , logger ) ,
66+ ...flags . normalizeSandboxOption ( options , logger ) ,
6767 } ;
6868 } else {
6969 modOptions = {
Original file line number Diff line number Diff line change @@ -156,6 +156,13 @@ export interface Options {
156156 @default false
157157 */
158158 readonly noSandbox : boolean ;
159+
160+ /**
161+ Enable sandbox on bundled Chromium on Linux platforms - recommended
162+
163+ @default true
164+ */
165+ readonly sandbox : boolean ;
159166}
160167
161168export type CLIOptions = Partial < Options > ;
You can’t perform that action at this time.
0 commit comments