MCPcopy
hub / github.com/garrytan/gstack / shouldEnableChromiumSandbox

Function shouldEnableChromiumSandbox

browse/src/browser-manager.ts:63–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61 * (Playwright will add it anyway when this returns false) and harmless.
62 */
63export 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.

Callers 4

launchMethod · 0.85
launchHeadedMethod · 0.85
handoffMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected