v1 with headless: false
This commit is contained in:
15
index.js
15
index.js
@@ -33,7 +33,20 @@ const height = argv.h;
|
||||
const filename = argv.n || `${Date.now()}.jpg`;
|
||||
|
||||
(async () => {
|
||||
const browser = await puppeteer.launch({ headless: false });
|
||||
const browser = await puppeteer.launch(
|
||||
{
|
||||
// executablePath: '/usr/bin/google-chrome-stable', // Use real Chrome if available -stable for ARCH derivative like Garuda linux (my os)
|
||||
// executablePath: '/usr/bin/firefox', // Adjust based on `which firefox`
|
||||
headless: false,
|
||||
args: [
|
||||
'--disable-blink-features=AutomationControlled',
|
||||
'--no-sandbox',
|
||||
'--disable-setuid-sandbox',
|
||||
'--disable-infobars',
|
||||
'--disable-dev-shm-usage'
|
||||
]
|
||||
}
|
||||
);
|
||||
const page = await browser.newPage();
|
||||
await page.setViewport({ width, height });
|
||||
await page.goto(url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
|
||||
Reference in New Issue
Block a user