webRequest API. In Manifest V3 the listeners are observational: you can log, measure, and analyze traffic, but not rewrite it in JavaScript.
What MV3 allows
Regular Chrome installs cannot use
webRequestBlocking in Manifest V3. If your goal is to block or rewrite traffic, declare rules instead. See Build an ad blocker.
Manifest
ThewebRequest events only fire for hosts that your extension can access, so pair the permission with host permissions.
manifest.json
Observe requests in the background
Register listeners at the top level of the background script, so the service worker re-registers them on every wake.background.js
details object carries the request id, tab id, method, URL, resource type, and timing. Correlate events by details.requestId to build a full request timeline.
Inspect requests in a devtools panel
For request inspection with response bodies, a devtools panel is the better surface. Thechrome.devtools.network API exposes finished requests as HAR entries, and it needs no webRequest permission.
The devtools_page registers the panel:
devtools/scripts.js
panel/scripts.js
chrome.devtools.network.getHAR to read what loaded before the panel attached.
Run it
Firefox differences
- Firefox Manifest V3 still supports blocking
webRequestwith thewebRequestBlockingpermission. - Firefox treats Manifest V3 host permissions as opt-in. Users grant them from the extensions panel, not at install time.
- Firefox runs the background as an event page, not a service worker. Top-level listener registration works on both.
- The devtools APIs above work in Firefox under the same
chrome.devtools.*names.
Start from a template
Thedevtools template ships a working devtools_page plus panel wiring.
Best practices
- Narrow the
urlsfilter on each listener instead of listening to<all_urls>in production. - Correlate events by
requestIdrather than by URL, since pages repeat URLs. - Keep listeners fast, because every observed request invokes them.
- Request the narrowest host permissions that your feature needs.
- Use
declarativeNetRequestfor blocking, and keepwebRequestfor observation.
Next steps
- Block traffic declaratively in Build an ad blocker.
- Review host permission hygiene in the Security checklist.
- Review Manifest V3 concepts for the service-worker lifecycle.

