* init * Add README * Add popup * Fix regex typo * Remove console * Update README * Set manager.html as the options page * Remove activeTab permission * Update code * Set ruleItem as a constant * Use `existingRules` instead of `_rules` * Wrapper input elements with label * Fix viewRuleButton * Move to functional-sample * Update README.md Co-authored-by: Joe Medley <jmedley@google.com> * Update README.md Co-authored-by: Joe Medley <jmedley@google.com> * Update README.md Co-authored-by: Joe Medley <jmedley@google.com> * Update README.md Co-authored-by: Joe Medley <jmedley@google.com> * Update README.md Co-authored-by: Joe Medley <jmedley@google.com> * Update functional-samples/sample.dnr-rule-manager/README.md Co-authored-by: Oliver Dunk <oliver@oliverdunk.com> * Remove setSaveButtonDisabled * Update description * Remove document.write * Remove nested function * Update functional-samples/sample.dnr-rule-manager/manifest.json --------- Co-authored-by: Joe Medley <jmedley@google.com> Co-authored-by: Oliver Dunk <oliver@oliverdunk.com>
chrome.declarativeNetRequest - No Cookies Rule Manager
This sample demonstrates using the chrome.declarativeNetRequest API to remove the Cookie header from requests matching custom URL filters.
Overview
This extension has two default rules:
-
Any main frame or XHR requests ending with
?nocookies=1will have their cookies removed (URL Filter). -
Any main frame or XHR requests matching
.*\.google\.comwill have their cookies removed (Regex Filter).
For example, install this extension and try navigating to https://github.com/GoogleChrome/chrome-extensions-samples?no-cookies=1 or https://www.google.com - you should appear signed out. The number of requests modified by this extension will be displayed on the extension's badge.
You can edit these rules in the manager page.
Implementation Notes
chrome.declarativeNetRequest.setExtensionActionOptions() sets the extension's badge text to the number of requests modified by the extension.
"declarativeNetRequestFeedback" permission is required to show the matching history.
Running this extension
- Clone this repository.
- Load this directory in Chrome as an unpacked extension.
- Click the extension's action icon to open the popup.
- Click the "Open Manager Tab" button to open the manager page.