Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import fs from "node:fs";
|
|
import { test } from "@playwright/test";
|
|
|
|
test("which worker script and protocol module the app loads", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
await page.addInitScript(() => {
|
|
const scope = window as unknown as { __workerUrls: string[] };
|
|
scope.__workerUrls = [];
|
|
const Original = window.Worker;
|
|
window.Worker = class extends Original {
|
|
constructor(url: string | URL, options?: WorkerOptions) {
|
|
scope.__workerUrls.push(String(url));
|
|
super(url, options);
|
|
}
|
|
} as unknown as typeof Worker;
|
|
});
|
|
await page.goto("/");
|
|
await page.waitForTimeout(15000);
|
|
const out = await page.evaluate(async () => {
|
|
const urls = (window as unknown as { __workerUrls: string[] }).__workerUrls;
|
|
const inspected: Record<string, unknown> = {};
|
|
for (const url of urls) {
|
|
try {
|
|
const response = await fetch(url);
|
|
const text = response.ok ? await response.text() : "";
|
|
inspected[url] = { status: response.status, bytes: text.length, hasPhysicsAllow: text.includes("'PHYSICS'"), hasOldAllow: text.includes("'WORLD', 'DATA', 'MATERIAL', 'MODIFIER', 'CONSTRAINT', 'BONE_CONSTRAINT'") };
|
|
}
|
|
catch (error) { inspected[url] = { error: String(error) }; }
|
|
}
|
|
return { urls, inspected };
|
|
});
|
|
fs.writeFileSync("/tmp/worker-urls.json", JSON.stringify(out, null, 2));
|
|
});
|