Manifest V3 Guide

Everything you need to plan, build, and migrate MV3—without breaking workflows or performance.

Service Worker declarativeNetRequest Messaging Publishing

TL;DR (Executive summary)

MV3 replaces background pages with service workers, shifts blocking to declarativeNetRequest (DNR), and tightens privacy & permissions. Design around lifecycle limits, quotas, and policy expectations.

Section snippets (examples)

Service worker lifecycle

  • Warm-up strategies, idempotent init, lazy imports, alarms for periodic work.
  • Keep long work out of transient events; use queues/backoff.

DNR vs webRequest

  • Map use-cases to declarative rules; handle limits; log rule hits for debugging.

Permissions & privacy

  • Least-privilege host permissions, user triggers, clear consent flows; accurate privacy labels tied to real data paths.

Migration checklist

  1. Inventory features/permissions → Parity map
  2. Refactor to SW/DNR
  3. Add telemetry
  4. Harden CSP & permissions
  5. Update listing assets → Submit → Reviewer Q&A

Callouts

Pitfalls: relying on long-lived state in SW; over-broad host permissions.
Good patterns: message-based orchestration; explicit user action gates.

MV2 → MV3: what actually changed

Background pages → service workers, blocking → DNR, stricter privacy, tighter permissions, and new quotas.

Offscreen documents

Use offscreen docs for rendering/DOM operations you can’t do in a worker—create and close explicitly.

Storage & quotas

Prefer IndexedDB for volume; use chrome.storage for settings; respect sync limits.

Messaging patterns

Use one-off messages for simple RPC; ports or BroadcastChannel for streams/long-lived coordination.

Scheduling & background work

Alarms + fetch + queues handle periodic jobs; keep steps idempotent; add backoff.

Testing & QA

Unit + integration + e2e (Playwright). Capture runtime errors; assert CSP and permissions.

Publishing & reviewer Q&A

Accurate permissions, privacy labels, and proactive answers reduce rejections.

Troubleshooting

Cold starts: warm alarms; timeouts: split tasks + queues; CSP: tighten and document sources.

Further reading & templates