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) <noreply@anthropic.com>
This commit is contained in:
2026-05-15 18:11:05 +02:00
parent 23e69d0b77
commit 6aeeda495c

View File

@@ -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({