Bug 257858 - getMatchedRules() from declarativeNetRequest not displaying the MatchedRule with the ruleId and rulesetId
Summary: getMatchedRules() from declarativeNetRequest not displaying the MatchedRule w...
Status: RESOLVED MOVED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Extensions (show other bugs)
Version: Safari 16
Hardware: Mac (Apple Silicon) macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-08 11:10 PDT by B Gill
Modified: 2023-08-04 17:05 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description B Gill 2023-06-08 11:10:03 PDT
When using getMatchedRules() from declarativeNetRequest
(https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#method-getMatchedRules), the item that is returned contains a "url" field instead of the MatchedRules object which should contain a ruleId and rulesetId:
https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-MatchedRule

This is an example of what is returned:
rulesMatchedInfo: [
	{
		request: {url: "https://example.com"}
		tabId: 2
		timeStamp: 1686247475669.134
	}
]

As shown above, it only has the "url", not the rule.

The changelog states that for Safari 16.4 getMatchedRules() "fixed result of getMatchedRules() to match other browsers" (https://webkit.org/blog/13966/webkit-features-in-safari-16-4/), however this still doesn't seem to return the same thing that other browsers do.

getMatchedRules() does not give the rule that was matched. It doesn't have the rule ID that was used (e.g. 1, 5, etc), and it does not have the ruleset ID (i.e. the id of the static rules file if it was from the static rules, or if it was a session rule: "_session", or if it was from the dynamic rules: "_dynamic").
Comment 1 Karl Dubost 2023-06-15 04:33:22 PDT
Not sure this is a WebKit bug, should probably be moved to Safari.
Comment 2 Radar WebKit Bug Importer 2023-06-15 04:33:33 PDT
<rdar://problem/110832269>
Comment 3 Brent Fulgham 2023-08-04 17:04:50 PDT
The fix for this bug needs to be made in another component. Switching to RESOLVED | MOVED, with work tracked by <rdar://problem/110832269>
Comment 4 Brent Fulgham 2023-08-04 17:05:11 PDT
Sorry -- I meant work is tracked by: rdar://97014835.