import puppeteer from "puppeteer-core"; const S = "/Users/umer/Documents/hf/tools/browser-tests/out"; const b = await puppeteer.launch({ executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", headless: true, userDataDir: S + "/shots/prof_og", args: ["--allow-file-access-from-files"] }); const p = await b.newPage(); await p.setViewport({ width: 1200, height: 630, deviceScaleFactor: 2 }); await p.goto("file://" + S + "/og/og.html", { waitUntil: "networkidle0" }); await p.evaluate(async () => { await document.fonts.ready; }); const f = await p.evaluate(() => [...document.fonts].filter((x) => x.status === "loaded").length); await p.screenshot({ path: S + "/og/og-image.png", type: "png" }); console.log("fonts loaded:", f); await b.close();