Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function handler ({ cwd, output }) {
const executablePath = process.env.PUPPETEER_EXECUTABLE_PATH || (await (chromeFinder)[getPlatform()]())[0]
if (!executablePath) {
throw new Error('Chrome / Chromium is not installed or environment variable PUPPETEER_EXECUTABLE_PATH is not set')
}
let browser = await puppeteer.launch({ executablePath })
let page = await browser.newPage()
await page.goto(`file://${cwd}/index.html`)
const [width, height] = await page.evaluate(async () => {
const container = document.querySelector('.shower')
const styles = window.getComputedStyle(container)
return [
styles.getPropertyValue('--slide-width'),
styles.getPropertyValue('--slide-height')