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.getSessionRules reports that rule exists before it's active #7

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

Comments

@lenacohen
Copy link
Collaborator

lenacohen commented Feb 28, 2025

declarativeNetRequest.getSessionRules() reports that session rules exist before they are actually active.

Our extension blocks social media widgets with DNR rules and replaces them with click-to-activate placeholders.
When a user clicks to activate a widget, we add a session rule to allow the social media request and wait for getSessionRules to confirm its presence before reloading the widget. Even after getSessionRules reports that the allow rule exists, the request is blocked for several seconds (2-8). This breaks our widget activation functionality which relies on getSessionRules to accurately report active session rules. This is not a problem on Chrome.

This delay does not occur in a demo extension with just a few rules, but does affect the Privacy Badger prototype which has around 4,000 dynamic rules and 20 session rules.

Expected Behavior: When getSessionRules reports that a session rule exists, it should be active.

Apple Feedback Assistant Report: FB16491079

@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