()
| 61 | * (Playwright will add it anyway when this returns false) and harmless. |
| 62 | */ |
| 63 | export function shouldEnableChromiumSandbox(): boolean { |
| 64 | if (process.platform === 'win32') return false; |
| 65 | // Explicit user override for Ubuntu/AppArmor and similar environments where |
| 66 | // unprivileged Chromium sandboxing is blocked even for normal users (the |
| 67 | // sandbox needs unprivileged user namespaces that the host policy denies, |
| 68 | // so /qa hangs without --no-sandbox). Setting GSTACK_CHROMIUM_NO_SANDBOX=1 |
| 69 | // forces the sandbox off without changing the default for everyone else. |
| 70 | // See #1562. |
| 71 | if (process.env.GSTACK_CHROMIUM_NO_SANDBOX === '1') return false; |
| 72 | const isRoot = typeof process.getuid === 'function' && process.getuid() === 0; |
| 73 | return !(process.env.CI || process.env.CONTAINER || isRoot); |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Resolve why the underlying Chromium ChildProcess is going away. |
no outgoing calls
no test coverage detected