While building SessionSnap, a session manager extension, I ran the extension in a real headless Chrome 154 against a local test server before submitting it to the store. The test run (19 checks) caught two bugs that unit tests had missed. Both were silent: nothing crashed visibly, things just did not work.
Bug 1 — importScripts resolves relative to the service worker, not the extension root
The background service worker lives at src/background.js and called importScripts('src/lib/...').
Chrome resolved that relative to the worker's own location, so it tried to load src/src/lib/... — a 404 — and the service worker failed to install.
Fix:
importScripts('lib/...');
Lesson: importScripts paths are relative to the service worker script, not the extension root. A wrong path here fails the whole worker install, not just one feature.
Bug 2 — an async IIFE that was never invoked
The message handler was written as (async()=>{...}).then(sendResponse) — the IIFE was missing its trailing () so the function was never called, and .then on a function throws "(intermediate value).then is not a function".
Result: every message to the background worker went unanswered; the popup and options page silently got nothing back.
Fix: add the () so the IIFE actually runs:
(async()=>{...})().then(sendResponse);
Lesson: this error only shows in the service worker console. From the popup side it looks like the background worker is simply ignoring you. Check the worker console first when messages go unanswered.
Both fixes landed before submission (tests went from 164 to 166 with two new regression tests), and the same real-browser run then passed 19/19 — snapshots, search, import, export, restore, close log, and the popup rendering. The point is not that these bugs were hard; it is that neither produced a visible error where I was looking. Real-browser testing before submission is what caught them.
SessionSnap's privacy policy is at https://alapha888.github.io/session-snap-privacy/ — the extension stores snapshots locally and makes no network requests.
Top comments (0)