Opened on 06/06/2017 at 04:09:24 AM
Last modified on 07/10/2018 at 03:57:59 PM
#5296 new change
[abp2blocklist] Improve $genericblock support using unless-top-url
Reported by: | mjethani | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Adblock-Plus-for-iOS/macOS | Keywords: | abp2blocklist |
Cc: | kzar, sebastian, mario | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Background
In #4329 we added limited support for $genericblock using the unless-domain property. Apple has added a new property in Safari 11 called unless-top-url, which takes a URL pattern instead of just a domain name. Now we can whitelist specific URL patterns instead of whitelisting the entire domain. Since Safari ignores any properties it does not recognize, we can start using this property in our content blocker rules right away.
What to change
Instead of unless-domain, use unless-top-url to implement $genericblock. Add any URL pattern to the list, even if it doesn't contain the hostname.
Continue to use unless-domain to support older versions of Safari based on a configuration flag.
Attachments (0)
Change History (2)
comment:1 Changed on 06/06/2017 at 08:53:39 AM by sebastian
comment:2 Changed on 07/10/2018 at 03:57:59 PM by sebastian
- Component changed from Platform to Adblock-Plus-for-iOS
abp2blocklist has been moved from the Platform module to Adblock Plus for iOS/macOS.
For reference, this change would unsupport $genericblock on Safari <=10, again. But FWIW, I think this is fine, if we can get more accurrate behavior on newer Safari versions, and possibly also simplify the code, with this change.
Also note that we could potentially make $document whitelisting more accurately as well using if-top-url, as they are supposed to be recursive.