#!/bin/env node import {firefox} from "playwright" const SCREENCAST_DURATION = 10000 const SCREEN_SIZE = {width: 1920, height: 1080} const browser = await firefox.launch() const page = await browser.newPage() await page.setViewportSize(SCREEN_SIZE) await page.goto("http://localhost:8080/") await page.evaluate(() => document.getElementById("app").style.display = "none") await page.screenshot({path: "screenshot.png"}) await page.screencast.start({ onFrame: (data) => { console.log('received frame', data); }, quality: 100, size: SCREEN_SIZE }) await new Promise((res) => setTimeout(res, SCREENCAST_DURATION)) await page.screencast.stop() await browser.close()