Service worker
Mv2’s background script is replaced by a service worker script. A few key differences:
- Lifetime model — Mv3’s service worker is started on demand (events, etc.) and may be killed when idle. This means that any state must be persisted to the browser’s storage or IndexedDB and re-hydrated on restart.
- API surface — for safety reasons, service workers have limited access to certain network and DOM APIs.