declarativeNetRequest.MatchedRule
描述匹配规则的对象。此类型可能由 declarativeNetRequest.getMatchedRules
或 declarativeNetRequest.testMatchOutcome
方法返回,也可以通过 declarativeNetRequest.onRuleMatchedDebug
事件观察到。
类型
此类型的值为对象,包含以下属性:
extensionId
-
string
。如果此规则属于其他扩展,则为该扩展的 ID。仅当与declarativeNetRequest.testMatchOutcome
一起使用,且将includeOtherExtensions
选项设置为true
时,才可用此属性。 ruleId
-
number
。匹配规则的 ID。 rulesetId
-
string
。此规则所属的规则集的 ID。返回的值为:- 对于来自静态规则集的规则,是在清单(manifest)键
declarative_net_request.rule_resources
中规则集的“id”键所指定的值。 - 对于来自动态规则集的规则,是在
declarativeNetRequest.DYNAMIC_RULESET_ID
中定义的值,即"_dynamic"
。 - 对于来自会话规则集的规则,是在
declarativeNetRequest.SESSION_RULESET_ID
中定义的值,即"_session"
。
- 对于来自静态规则集的规则,是在清单(manifest)键
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | ||||||
---|---|---|---|---|---|---|---|
MatchedRule | |||||||
extensionId |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.