Service worker lifecycle
- Warm-up strategies, idempotent init, lazy imports, alarms for periodic work.
- Keep long work out of transient events; use queues/backoff.
Resources / Guide
Everything you need to plan, build, and migrate MV3—without breaking workflows or performance.
MV3 replaces background pages with service workers, shifts blocking to declarativeNetRequest (DNR), and tightens privacy & permissions. Design around lifecycle limits, quotas, and policy expectations.
Background pages → service workers, blocking → DNR, stricter privacy, tighter permissions, and new quotas.
Use offscreen docs for rendering/DOM operations you can’t do in a worker—create and close explicitly.
Prefer IndexedDB for volume; use chrome.storage
for settings; respect sync limits.
Use one-off messages for simple RPC; ports or BroadcastChannel for streams/long-lived coordination.
Alarms + fetch + queues handle periodic jobs; keep steps idempotent; add backoff.
Unit + integration + e2e (Playwright). Capture runtime errors; assert CSP and permissions.
Accurate permissions, privacy labels, and proactive answers reduce rejections.
Cold starts: warm alarms; timeouts: split tasks + queues; CSP: tighten and document sources.