Include AdGuard URL Tracking filter
Prerequisites
- [X] I checked to make sure that this issue has not already been filed;
- [X] This is not an ad/bug report.
Problem description
I notice that the AdGuard URL Tracking filter is not included in the list of filters.
Proposed solution
I checked the rules and found most of them are removeparam rules. To my understanding it requires the redirect action on Safari side.
Apple added support for redirect 10 months ago as mentioned in https://webkit.org/blog/12193/release-notes-for-safari-technology-preview-139/
Added support for the
redirectrule type indeclarativeNetRequest, which requires host permissions to be granted for the host of the URL being redirected
I think this feature is available in Safari 16 but Apple haven't updated their documentation.
Additional information
No response
Currently, adguard for safari uses content blockers for filtering (https://developer.apple.com/documentation/safariservices/creating_a_content_blocker)
In the release notes, they talk about web extensions. Maybe in the future adguard for safari would start using under-the-hood web extensions too.
Thanks for the explanations. I thought AdGuard is using Web Extensions :)
Well, on the other hand in the case of Safari declarativeNetRequest is built on Safari content blockers. Maybe it was added there as well?
Here's the relevant changeset in Safari: https://trac.webkit.org/changeset?reponame=webkit&new=287040%40trunk&old=287039%40trunk
Had a talk with a WebKit engineer.
redirectrules are actually available via content blockers file: https://github.com/WebKit/WebKit/blob/cf203f4511ff5d596126af5057da721eb625901f/Source/WebCore/contentextensions/ContentExtensionActions.cpp#L311- The problem is that they won't work as they require extension to be granted explicit permissions on the affected URLs. These permissions can only be granted to Web Extensions.
So currently we're in the following situation:
- dNR supports pretty much everything from CB except one very important thing - cosmetic rules.
- Therefore using just Web Extensions makes little sense, we have to stick to CB.
- We could bring
redirectrules to AdGuard for iOS as it uses a Web Extension for advanced ad blocking functionality. We should also consider finally switching AdGuard for Safari to using a Web Extension instead of the legacy Safari extension.