Declarative Net Request
declarativeNetRequestInstall Warning
"Block content on any page."
Technical Context
Provides access to the chrome.declarativeNetRequest API, a modern replacement for webRequestBlocking that uses declarative rules processed by the browser engine. This approach is more efficient and privacy-preserving.
What This Means For You
The extension can block or redirect web requests using rules that Chrome processes internally. This is a more private approach because the extension never sees your actual browsing data.
Related APIs
This permission enables access to these Chrome APIs:
chrome.declarativeNetRequestCommon Use Cases
- ✓Ad blockers
- ✓Content filters
- ✓Privacy tools
How to Declare in manifest.json
Add the "declarativeNetRequest" permission to your extension manifest:
{
"manifest_version": 3,
"name": "My Extension",
"permissions": [
"declarativeNetRequest"
]
}What Users Will See
When users install your extension, Chrome will display this warning:
This extension can:
"Block content on any page."
Related Permissions
Web Request
webRequestThe extension can see the network requests your browser makes, like which images or scripts a page loads. By itself, it can only watch traffic, not change it.
Declarative Net Request (Host Access)
declarativeNetRequestWithHostAccessThis is a safer version of an ad-blocker that only works on the specific websites you choose. It protects your privacy by letting the browser handle the filtering, ensuring the extension does not see your sensitive information.
Declarative Net Request Feedback
declarativeNetRequestFeedbackThe extension can see which of its blocking rules were triggered by specific requests. This helps developers understand why content was blocked or allowed.
Web Request Blocking
webRequestBlockingThe extension can block, redirect, or modify any request your browser makes before it happens. This is how ad blockers work, but it also means the extension controls what data reaches websites.
Web Request Auth Provider
webRequestAuthProviderThe extension can automatically provide usernames and passwords when websites request them through browser popup dialogs. This is useful for corporate proxies or secured intranet sites.