Puppeteer + Playwright
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
module.exports = (chromium) => {
|
||||
return async (req, res, next) => {
|
||||
|
||||
const browser = await chromium.launch({
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu', '--disable-dev-shm-usage'],
|
||||
headless: true
|
||||
});
|
||||
|
||||
req.playwrightBrowser = browser;
|
||||
next();
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ module.exports = (puppeteer) => {
|
||||
executablePath: '/usr/bin/google-chrome',
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu'],
|
||||
ignoreDefaultArgs: ['--disable-extensions'],
|
||||
headless: 'new'
|
||||
headless: 'true'
|
||||
});
|
||||
|
||||
req.browser = browser;
|
||||
req.puppeteerBrowser = browser;
|
||||
next();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user