-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs for MAX_NUMBER_OF_DISABLED_STATIC_RULES #34447
Docs for MAX_NUMBER_OF_DISABLED_STATIC_RULES #34447
Conversation
...add-ons/webextensions/api/declarativenetrequest/max_number_of_disabled_static_rules/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mozilla/add-ons/webextensions/api/declarativenetrequest/index.md
Show resolved
Hide resolved
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has merge conflicts that must be resolved before it can be merged. |
...add-ons/webextensions/api/declarativenetrequest/max_number_of_disabled_static_rules/index.md
Outdated
Show resolved
Hide resolved
This limit is: | ||
|
||
- in Firefox: `5000` | ||
- in Chrome: `5000` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Chrome the limit is across all static rulesets.
(In Firefox it is per ruleset)
@rpl Could you confirm that this is intentional? What should we document?
EDIT: I announced our behavior at w3c/webextensions#162 (comment)
...add-ons/webextensions/api/declarativenetrequest/max_number_of_disabled_static_rules/index.md
Outdated
Show resolved
Hide resolved
@@ -7,7 +7,7 @@ browser-compat: webextensions.api.declarativeNetRequest.updateStaticRules | |||
|
|||
{{AddonSidebar}} | |||
|
|||
Modifies the enabled state of rules in a static ruleset. | |||
Modifies the enabled state of rules in a static ruleset. The number of rules that can be disabled in a ruleset is limited to the value of {{WebExtAPIRef("declarativeNetRequest.MAX_NUMBER_OF_DISABLED_STATIC_RULES","MAX_NUMBER_OF_DISABLED_STATIC_RULES")}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon taking a closer look I noticed that limits are not well documented in the individual articles. Let's delete this part here, and append something like this at the end of the section:
The number of enabled and disabled rules is limited, as explained at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest#static_ruleset_limits
(Also do this at getAvailableStaticRuleCount and the other constants)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rob--W hopefully updated all the appropriate "other constants" and I've added the link to the manifest key where we had no particular comment about limits previously
@@ -104,6 +104,7 @@ An extension can: | |||
|
|||
- specify static rulesets as part of the [`"declarative_net_request"`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/declarative_net_request) manifest key up to the value of {{WebExtAPIRef("declarativeNetRequest.MAX_NUMBER_OF_STATIC_RULESETS","MAX_NUMBER_OF_STATIC_RULESETS")}}. | |||
- enable static rulesets up to at least the value of {{WebExtAPIRef("declarativeNetRequest.GUARANTEED_MINIMUM_STATIC_RULES","GUARANTEED_MINIMUM_STATIC_RULES")}}, and the number of enabled static rulesets must not exceed the value of {{WebExtAPIRef("declarativeNetRequest.MAX_NUMBER_OF_ENABLED_STATIC_RULESETS","MAX_NUMBER_OF_ENABLED_STATIC_RULESETS")}}. In addition, the number of rules in enabled static rulesets for all extensions must not exceed the global limit. Extensions shouldn't depend on the global limit having a specific value and should instead use {{WebExtAPIRef("declarativeNetRequest.getAvailableStaticRuleCount","getAvailableStaticRuleCount")}} to find the number of additional rules they can enable. | |||
- disable rules in a static rulesets up to the value of {{WebExtAPIRef("declarativeNetRequest.MAX_NUMBER_OF_DISABLED_STATIC_RULES","MAX_NUMBER_OF_DISABLED_STATIC_RULES")}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- disable rules in a static rulesets up to the value of {{WebExtAPIRef("declarativeNetRequest.MAX_NUMBER_OF_DISABLED_STATIC_RULES","MAX_NUMBER_OF_DISABLED_STATIC_RULES")}}. | |
- disable rules in a static rulesets up to the value of {{WebExtAPIRef("declarativeNetRequest.MAX_NUMBER_OF_DISABLED_STATIC_RULES","MAX_NUMBER_OF_DISABLED_STATIC_RULES")}}. Disabling individual rules does not increase the number of available static rules. |
Maybe also link to the full explanation at w3c/webextensions#162 (comment)
(If you see a better way to describe what I wrote, please do so. It looks very subtle.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rob--W I have rephrased this section, please take a look. In addition, given that we note that "the number of rules in enabled static rulesets for all extensions must not exceed the global limit," do we need to say something about what happens if someone tries to install an extension that (given other extensions they may have installed) exceeds that global limit?
Co-authored-by: Rob Wu <rob@robwu.nl>
...add-ons/webextensions/api/declarativenetrequest/max_number_of_disabled_static_rules/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Rob Wu <rob@robwu.nl>
Description
Adds documentation and release note for the
declarativeNetRequest
typeMAX_NUMBER_OF_DISABLED_STATIC_RULES
addressing the dev–doc-needed request from Bug 1896628 [DNR] Enforce a limit to the maximum number of static rules disabled individually.Related issues and pull requests
BCD mdn/browser-compat-data#23533