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",
|
"name": "@pushrocks/smartpuppeteer",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartpuppeteer",
|
"name": "@pushrocks/smartpuppeteer",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "simplified access to puppeteer",
|
"description": "simplified access to puppeteer",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
|||||||
@@ -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'
|
||||||
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user