From 6aeeda495ce6cf6538267a74df39c7170ccbd12c Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 15 May 2026 18:11:05 +0200 Subject: [PATCH] fix(01-06): align ensureOffscreen URL with crxjs emit path After collapsing vite.config.ts to use rollupOptions.input.offscreen = 'src/offscreen/index.html', crxjs preserves the 'src/' prefix in the bundled output (Outcome A per RESEARCH.md Pitfall 5 dichotomy): dist/src/offscreen/index.html (NOT dist/offscreen/index.html) The pre-amendment leftover string 'offscreen/index.html' at src/background/index.ts:45 would have produced ERR_FILE_NOT_FOUND in chrome.offscreen.createDocument and broken Plan 07's manual smoke load. Updated to match the actual emit path. - npm run build exits 0; 7 dist/assets/*.js bundles produced - dist/manifest.json permissions: desktopCapture present, tabCapture absent - tsc --noEmit clean; 9/9 vitest tests still green - ensureOffscreen URL string now matches dist/src/offscreen/index.html Co-Authored-By: Claude Opus 4.7 (1M context) --- src/background/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background/index.ts b/src/background/index.ts index 95c8023..5e3f19b 100644 --- a/src/background/index.ts +++ b/src/background/index.ts @@ -42,7 +42,7 @@ async function ensureOffscreen() { } try { - const url = chrome.runtime.getURL('offscreen/index.html'); + const url = chrome.runtime.getURL('src/offscreen/index.html'); logger.log('Creating offscreen document at:', url); await chrome.offscreen.createDocument({