An object describing the matched rule. This type may be returned by the declarativeNetRequest.getMatchedRules
or declarativeNetRequest.testMatchOutcome
methods, or observed through the declarativeNetRequest.onRuleMatchedDebug
event.
On this page
declarativeNetRequest.MatchedRule
Type
Values of this type are objects. They contain these properties:
-
extensionId
-
A
string
. The ID of the extension, if this rule belongs to a different extension. This property is only available when used withdeclarativeNetRequest.testMatchOutcome
, with theincludeOtherExtensions
option set totrue
. -
ruleId
-
A
number
. The matching rule's ID. -
rulesetId
-
A
string
. The ID of the ruleset this rule belongs to. The value returned is:- For a rule originating from the set of static rules, the value specified in the "id" key of the ruleset in the
declarative_net_request.rule_resources
manifest key. - For a rule originating from the set of dynamic rules, the value defined in
declarativeNetRequest.DYNAMIC_RULESET_ID
, i.e.,"_dynamic"
. - For a rule originating from the set of session rules, the value defined in
declarativeNetRequest.SESSION_RULESET_ID
, i.e.,"_session"
.
- For a rule originating from the set of static rules, the value specified in the "id" key of the ruleset in the
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
MatchedRule |
84 | 84 | No | ? | 70 | No | ? | ? | No | ? | No | ? |
extensionId |
No | No | No | ? | No | No | ? | ? | No | ? | No | ? |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/MatchedRule