0Pricing
Browser Extensions Development (Chrome & Edge) · Lesson

Dynamic Rules & Debugging declarativeNetRequest

Add and update rules at runtime, manage rule IDs and priorities, and observe matched requests for debugging.

Static vs Dynamic Rules

declarativeNetRequest supports two rule kinds. Static rules ship in JSON files in the manifest. Dynamic rules are added at runtime and persist across restarts.

Dynamic rules let your extension adapt to user choices without an update.

Declaring the Permission

You need the declarativeNetRequest permission. For dynamic rules at runtime, that is all you require.

{
  "permissions": ["declarativeNetRequest"]
}

All lessons in this course

  1. Blocking Network Requests
  2. Modifying Request Headers
  3. Redirecting & Rewriting URLs
  4. Dynamic Rules & Debugging declarativeNetRequest
← Back to Browser Extensions Development (Chrome & Edge)