Add dev/: training and export scripts, GPAI rule tests, browser tests, workspace map
28e3615 verified Download dev/browser-tests/og.mjs from Devseis/Caveat: direct link, hf CLI and curl.
- Browser
- Download file 770 Bytes
-
https://huggingface.co/spaces/Devseis/Caveat/resolve/main/dev/browser-tests/og.mjs
- Command line
-
hf download hf://spaces/Devseis/Caveat/dev/browser-tests/og.mjs
-
curl -L -o og.mjs https://huggingface.co/spaces/Devseis/Caveat/resolve/main/dev/browser-tests/og.mjs
770 Bytes
| 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(); | |