Closed AdamWr closed 3 years ago
Hmm, the problem is, when opening the page from the search results, the referrer is google.com
, which doesn't match any domains in the rule. How does it work for other types of rules?
For example, if I use rule like this:
$image,third-party,domain=arcelik.com.tr|uspoloassn.com|example.org
then it seems that it's applied.
I see, the images are loaded from the page itself, so the requests for them have uspoloassn.com
as the referrer, but the page is loaded from the search results, so there the referrer is google.com
(and doesn't match any rules). This is highly unintuitive, but I can't think of how we can handle this :(
I think, if the intention is to remove parameter ref
only from URLs containing arcelik.com.tr|uspoloassn.com|example.org
then the $domain
is actually not the right solution in the first place: the rule should be something like
/.*\://(.*\.)?(arcelik.com\.tr|uspoloassn\.com|example\.org)((/|\:|\?).*|$)/$removeparam=ref
(or three separate rules)
I have just added:
||uspoloassn.com^$removeparam=ref
||arcelik.com.tr^$removeparam=ref
to AdGuard URL Tracking filter
and it works fine, but there is another filter list (Legitimate URL Shortener
) which contains a lot of rules with domain
and removeparam
modifier:
If I understand correctly, these rules will not work if it will be opened from Google search results.
Depends on the value of the $domain
modifier, for example this rule:
$removeparam=sourceid,domain=~google.*
looks like the author specifically wanted to NOT remove the params when opened from the search results (the modifier reads something like this: "limit the scope of the rule to only when the referrer is not google-dot-something")
I understand it in a different way :)
For me, it means that this parameter should not be removed only on google.*
, but it should be removed on any different website, so it should be also removed on these websites which are opened from search results, and it seems that it works like that in AdGuard extension.
But it works differently in AdGuard apps.
Turns out there was an issue with this special case not working: https://github.com/AdguardTeam/AdguardKnowledgeBase/blob/master/01.general/02.how-to-create-your-own-ad-filters/docs.en.md#domain-modifier-matching-target-domain Fixed in core/pull-requests/2491
Probably related to this issue - https://github.com/AdguardTeam/CoreLibs/issues/1421
Steps to reproduce:
AdGuard URL Tracking filter
and add this rule:Opened link looks like that:
$removeparam=ref,domain=arcelik.com.tr|uspoloassn.com|example.org
should removesref=AffOcean
, but it doesn't work.Similar for exception rules, for example if
AdGuard URL Tracking filter
is enabled and I add@@$removeparam=utm_term,domain=uspoloassn.com
to user filter and open website clicking on one of the Google search result (from link from seconds step) then parameter is still removed. I have to add@@$removeparam=utm_term,domain=google.com
to whitelist it. I think that it shouldn't work like this.AdGuard for Windows 7.7 nightly 10 (build 3626, CL 1.8.141)