Skip to content

Commit

Permalink
Update for current puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
workeffortwaste committed Nov 14, 2024
1 parent e1c1262 commit 185881e
Show file tree
Hide file tree
Showing 3 changed files with 4,415 additions and 13 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const exportVideo = async () => {
console.log(`${options.url}\n`)

/* Start the browser fullscreen in the background (headless) */
const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox', '--allow-file-access-from-files', '--start-fullscreen'] })
const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox', '--allow-file-access-from-files', '--kiosk'] })
const page = await browser.newPage()

/* Set the viewport and scale from the cli options */
Expand All @@ -310,7 +310,7 @@ const exportVideo = async () => {
}

/* Wait for a bit because GSAP takes a little bit of time to initialise and the script was missing it. */
page.waitForTimeout(2000)
await page.evaluate(() => new Promise(resolve => setTimeout(resolve, 2000)))

/* Check the selector exists */
const validSelector = await page.evaluate(discoverSelector, options.selector)
Expand Down
Loading

0 comments on commit 185881e

Please sign in to comment.