Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd6f24551d | |||
| f4d0e9ad87 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartpuppeteer",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartpuppeteer",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"private": false,
|
||||
"description": "simplified access to puppeteer",
|
||||
"main": "dist/index.js",
|
||||
|
||||
@@ -19,21 +19,30 @@ export const getEnvAwareBrowserInstance = async (
|
||||
if ((process.env.CI || options.forceNoSandbox) && !smartenv.isWsl) {
|
||||
chromeArgs = chromeArgs.concat([
|
||||
'--no-sandbox',
|
||||
'--disable-setuid-sandbox'
|
||||
// '--disable-dev-shm-usage'
|
||||
'--disable-setuid-sandbox',
|
||||
'--disable-dev-shm-usage'
|
||||
]);
|
||||
}
|
||||
|
||||
let headlessBrowser: plugins.puppeteer.Browser;
|
||||
if (!smartenv.isWsl) {
|
||||
// lets get the actual instance
|
||||
console.log('launching puppeteer bundled chrome');
|
||||
headlessBrowser = await plugins.puppeteer.launch({
|
||||
args: chromeArgs
|
||||
});
|
||||
} else {
|
||||
console.log('Detected WSL. Using chromium.');
|
||||
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'
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user