// Debug harness: load a demo page, capture console + page errors + #err content. import { chromium } from "@playwright/test"; const path = process.argv[2] ?? "/demo/no-coi.html"; const browser = await chromium.launch(); const page = await browser.newPage(); page.on("console", (m) => console.log(`[console:${m.type()}]`, m.text())); page.on("pageerror", (e) => console.log("[pageerror]", e.message, "\n", e.stack?.split("\n").slice(0, 4).join("\n"))); page.on("requestfailed", (r) => console.log("[requestfailed]", r.url(), r.failure()?.errorText)); page.on("worker", (w) => console.log("[worker created]", w.url())); await page.goto(`http://localhost:8931${path}`); await page.waitForTimeout(3000); const err = await page.locator("#err").textContent().catch(() => null); const out = await page.locator("#out").textContent().catch(() => null); const exit = await page.locator("#exit").textContent().catch(() => null); console.log(JSON.stringify({ out, err, exit }, null, 2)); await browser.close();