fix(core): update
This commit is contained in:
parent
41aefa7f18
commit
f4d0e9ad87
@ -19,21 +19,30 @@ export const getEnvAwareBrowserInstance = async (
|
|||||||
if ((process.env.CI || options.forceNoSandbox) && !smartenv.isWsl) {
|
if ((process.env.CI || options.forceNoSandbox) && !smartenv.isWsl) {
|
||||||
chromeArgs = chromeArgs.concat([
|
chromeArgs = chromeArgs.concat([
|
||||||
'--no-sandbox',
|
'--no-sandbox',
|
||||||
'--disable-setuid-sandbox'
|
'--disable-setuid-sandbox',
|
||||||
// '--disable-dev-shm-usage'
|
'--disable-dev-shm-usage'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let headlessBrowser: plugins.puppeteer.Browser;
|
let headlessBrowser: plugins.puppeteer.Browser;
|
||||||
if (!smartenv.isWsl) {
|
if (!smartenv.isWsl) {
|
||||||
// lets get the actual instance
|
// lets get the actual instance
|
||||||
|
console.log('launching puppeteer bundled chrome');
|
||||||
headlessBrowser = await plugins.puppeteer.launch({
|
headlessBrowser = await plugins.puppeteer.launch({
|
||||||
args: chromeArgs
|
args: chromeArgs
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('Detected WSL. Using chromium.');
|
console.log('Detected WSL. Using chromium.');
|
||||||
headlessBrowser = await plugins.puppeteer.launch({
|
headlessBrowser = await plugins.puppeteer.launch({
|
||||||
executablePath: '/usr/bin/chromium-browser'
|
args: [
|
||||||
|
'--disable-gpu',
|
||||||
|
'--disable-dev-shm-usage',
|
||||||
|
'--disable-setuid-sandbox',
|
||||||
|
'--no-first-run',
|
||||||
|
'--no-sandbox',
|
||||||
|
'--no-zygote',
|
||||||
|
'--single-process'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user