EFForg / EFForg/SafariWebExtensionBugs

declarativeNetRequest.getMatchedRules returns incomplete information

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
DNR
Dominant language
No language data
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

`declarativeNetRequest.getMatchedRules` seems to return incomplete information.

Due to Safari’s incomplete implementation of the `webRequest` API (#5, #4), we are attempting to report what our extension is blocking with `declarativeNetRequest.getMatchedRules`. Unfortunately, the return value is often missing requests that were blocked by DNR rules (i.e. requests that appear in the network tab when my extension is disabled but disappear for the same website after the extension is enabled).

I don't think that the problem is the `filter` used with `getMatchedRules` because there are missing values when no filter parameters are input.

Testing `getMatchedRules` with our Privacy Badger prototype yields different numbers of matched rules for a given tabId depending on whether or not the tabId was filtered for within or outside the `getMatchedRules` call. On one tab, for example:
- Calling `declarativeNetRequest.getMatchedRules()` with no filter parameters then filtering the results for the tabId yields 118 matches.
- Calling `declarativeNetRequest.getMatchedRules({tabId: 419})` with the same tabId as one of the getMatchedRules filter parameters yields 153 matches.

Apple Feedback Assistant Report: [FB16491088](https://feedbackassistant.apple.com/feedback/16491088)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.