chrome-launcher
chrome-launcher copied to clipboard
unsupported flag --disable-setuid-sandbox
I suggest removing this code, the flag is no longer used in chrome.
if (process.platform === 'linux') {
flags.push('--disable-setuid-sandbox');
}
AFAIk this flag IS used: https://cs.chromium.org/search/?q=kDisableSetuidSandbox&sq=package:chromium&type=cs
See the zygote_host_impl_linux.cc results.
Hi guys, I need to launch a headless chrome without this flag to run my tests. There is any particular reason to this flag be obligatory on Linux?
This flag would cause this error and cannot launch chrome
27907:27907:0205/194525.657250:FATAL:zygote_host_impl_linux.cc(107)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
[1] 27907 abort /usr/bin/google-chrome-stable --disable-translate --disable-extensions
Any reason why @samccone's commit wasn't merged? I'd love to get rid of this annoying warning :thinking:
@calebeby see https://github.com/GoogleChrome/chrome-launcher/pull/68#issuecomment-377825645, if you'd like to be the one to pick it up, be our guest :)
@patrickhulce I'm not sure I completely understand the relation between this issue and the linked PR. If I submitted a PR that just removed the --disable-setuid-sandbox flag, but didn't do anything else related to Alpine linux, would that be accepted?
any update on this?
This flag is still in use in the Chromium codebase AFAICT, so we would like to continue supporting it, but we've added ignoreDefaultFlags as a way to disable other default flags in chrome-launcher that doesn't yet affect this one.
If anyone would like to submit a PR that adds a check for ignoreDefaultFlags to https://github.com/GoogleChrome/chrome-launcher/blob/e67a10dffccd1d7509d671145b0b4ee368e34528/src/chrome-launcher.ts#L150-L152
I think that sounds good! 👍
I have found a workaround for this on Linux.
You can use the ignoreDefaultFlags setting as follows:
const ChromeLauncher = require('chrome-launcher');
var flags = ChromeLauncher.Launcher.defaultFlags();
// optional: filter out flags
// Eg. Enabling extensions and Audio
// flags = flags.filter(flag => flag !== '--disable-extensions' && flag !== '--mute-audio')
// optional: Add you own flags
// flags.push('--proxy-server=192.168.101.200:8213')
ChromeLauncher.launch({
startingUrl: ''
,userDataDir: '/dpool/vcmain/sys/chrome/profiles/CORP_DEV_LOCAL'
,ignoreDefaultFlags: true
,chromeFlags: flags
}).then(chrome => {
console.log(`Chrome debugging port running on ${chrome.port}`);
});