-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add AdGuard's $network support on Firefox #2792
Comments
Related #1070 (comment)
Will blocking on response suffice? |
If can then display strict-blocking page. |
Goodness knows how this would be implemented in practice, but |
Related commit (forgot to link issue in commit message): gorhill/uBlock@c6dedd2 |
Ok i tested on |
It's possible to |
Real use case? I did look at whether document should be blocked but it turned out to be a bit more work then I expected so I left this out. |
I was thinking about those domains from badware that have a lot of similar domains in the same ip Though we would need to be very careful to not block legitimate sites. |
I did some testing for 40min tonight in Firefox 130.0 with uBO 1.51.1b17. I don't intend to put immediate pressure on any involved parties, I'm simply listing them.
• "I did look at whether [$doc] should be blocked but it turned out to be a bit more work then I expected so I left this out." |
Somehow I thought Firefox's Fixed in 1.59.1b18 |
This commit makes the DNS resolution code better suited for both filtering on cname and ip address. The change allows early availability of ip address so that `ipaddress=` option can be matched at onBeforeRequest time. As a result, it is now possible to block root document using `ipaddress=` option -- so long as an ip address can be extracted before first onBeforeRequest() call. Related issue: uBlockOrigin/uBlock-issues#2792 Caveat ------ the ip address used is the first one among the list of ip addresses returned by dns.resolve() method. There is no way for uBO to know which exact ip address will be used by the browser when sending the request, so this is at most a best guess. The exact IP address used by the browser is available at onHeadersReceived time, and uBO will also filter according to this value, but by then the network request has already been sent to the remote server. Possibly a future improvement would make available the whole list of ip addresses to the filtering engine, but even then it's impossible to know with certainty which ip address will ultimately be used by the browser -- it is entirely possible that the ip address used by the browser might not be in the list received through dns.resolve().
It's normal, the first time the IP address is not available in uBO's DNS cache, so the first call to onBeforeRequest() will log a non-matched entry. Once the the DNS resolution occurs, there will be another call to onBeforeRequest but with the IP address available, which will then match your filter. It works like this:
It's also how matching against cname has been working, there is always two entries in the logger when there is a cname. The logger really reports request matching calls, and there can be more than one. I suppose it would be useful to show at which stage the matching is made so that we know whether there was an actual request reaching the remote server, but there is not much horizontal space for more details in the logger. |
This comment was marked as abuse.
This comment was marked as abuse.
|
This comment was marked as abuse.
This comment was marked as abuse.
Negation and multi-address won't be implemented, there is no actual real world use cases for this.
What task? |
Prerequisites
I tried to reproduce the issue when...
Description
Documentation: https://adguard.com/kb/general/ad-filtering/create-own-filters/#network-modifier
Related issue: AdguardTeam/tsurlfilter#104
A specific URL where the issue occurs.
https://github.com/AdguardTeam/AdguardFilters/pull/160415/files
Steps to Reproduce
Check the links above
Expected behavior
NA
Actual behavior
NA
uBO version
1.51.0
Browser name and version
Firefox 116.0.3
Operating System and version
Windows 10
The text was updated successfully, but these errors were encountered: