Felipe Erias talks about Igalia's work toward improving chromium's Declarative Net Request rules proposed for Manifest V3
(c) BlinkOn 16
Virtual Event, May 18 - 19, 2022
https://www.chromium.org/events/blinkon-16/
3. Web Extensions: manifest V3
Privacy: less need to access user data
Security: stricter protocols and requirements
Performance
Follow the Web Platform way of doing things
Keep the platform capable and valuable for users
3
4. Declarative Net Request
Provide control over network requests (including
blocking resources)
Previously: network requests are intercepted and
evaluated in the extension process
Now: extension declares a set of rules that the
browser uses to evaluate and modify requests
4
5. Rule resources (1)
Static lists of rules are bundled with the extension
Can only be modified by updating the extension
Enabled and disabled as a whole
Limits: 10 enabled lists, up to 30,000 rules
// Enable ruleset with id "myRules"
chrome.declarativeNetRequest.updateEnabledRulesets(
{
disableRulesetIds: ["unusedList"],
enableRulesetIds: ["myRules"]
}
5
6. Rule resources (2)
Dynamic rules
Can be added and removed one by one
Lifetimes
only current session, or
across sessions and extensions updates
Limit: up to 5,000 rules
chrome.declarativeNetRequest.updateDynamicRules(…);
chrome.declarativeNetRequest.updateSessionRules(…);
6
9. Going forward?
With the move to Declarative Net Request, this will
become harder to fix:
Need to update the extension to amend the
problematic static rule
Disabling the whole list breaks functionality
Adding a dynamic rule risks side effects
9
11. Our proposal
When you enable a static list you may disable some of
its rules
// Enable ruleset with id "myRules",
// but disabling rules 1 and 5
chrome.declarativeNetRequest.updateEnabledRulesets({
disableRulesetIds: ["unusedList"],
enableRulesetIds: ["myRules"],
disableRules: [{
rulesetId: "myRules",
disableRulesIds: [ 1, 5 ]
}]
});
11
12. Feedback welcome!
Chromium bug
Web Extensions WG
Extension API proposal
https://crbug.com/1225229
https://github.com/w3c/webextensions/issues/162
https://docs.google.com/document/d/1NTOTr6iwm0dJbewWjnABmPo6h1QD1mKTpX60s6Klj-
8/edit?usp=sharing
12