Skip to content
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

declarativeNetRequest.getMatchedRules returns incomplete information #6

Open
lenacohen opened this issue Feb 28, 2025 · 0 comments
Open
Labels
DNR Issue with Safari's Declarative Net Request API

Comments

@lenacohen
Copy link
Collaborator

declarativeNetRequest.getMatchedRules seems to return incomplete information.

Due to Safari’s lack of support of the webRequest API, 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

@lenacohen lenacohen added the DNR Issue with Safari's Declarative Net Request API label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNR Issue with Safari's Declarative Net Request API
Projects
None yet
Development

No branches or pull requests

1 participant