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

Do not block tabs by $popup modifier which are opened by a user #2489

Open
slavaleleka opened this issue Sep 14, 2023 · 2 comments
Open

Do not block tabs by $popup modifier which are opened by a user #2489

slavaleleka opened this issue Sep 14, 2023 · 2 comments

Comments

@slavaleleka
Copy link
Contributor

slavaleleka commented Sep 14, 2023

AdGuard Extension version

4.2.168

Browser version

Chrome 116

OS version

macos 13.5.2

Steps to reproduce

  1. add a rule $popup,domain=iana.org
  2. go to example.com
  3. open "More information..." link in a new tab

Result:
The new tab is closed by the rule but it shouldn't be.
the same happens when the tab is opened by js in the console:

window.open('https://www.iana.org/domains/example')

The main problem that there is no way to detect which tab is opened by a user manually and which one is opened programmatically. $popup modifier rule is applied on the onBeforeRequest event where isNewPopupTab() returns the same result for both cases — true, and the tab is being closed.

It would be helpful if the details object has a new boolean property, for example, initiatedByUser, because now all other properties do not provide enough data to calculate it:
https://developer.chrome.com/docs/extensions/reference/webRequest/#event-onBeforeRequest

Expected Behavior

Tab opened by a user should not be blocked by $popup modifier rules

@slavaleleka
Copy link
Contributor Author

after the issue is resolved, it may be possible to handle logging of $popup rules:
#1686

@infinity-surfer
Copy link

@@ — a marker that is used in rules of exception. To turn off filtering for a request, start your rule with this marker.

So I think you need to use: @@||iana.org^$popup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants