v1 with headless: false

This commit is contained in:
Kar
2025-03-14 01:52:26 +05:30
parent d9c126bb96
commit 12112b4ac2
9 changed files with 435 additions and 7 deletions

View File

@@ -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 });