Some types of rules require executing javascript on web pages which currently cannot be done.
I am talking about extended CSS rules and extended CSS support.
In theory, it should be possible to achieve using injected scripts and injected scripts <-> app extension messaging:
https://developer.apple.com/documentation/safariservices/safari_app_extensions/injecting_a_script_into_a_webpage
First of all, we need a proof of concept
Then if it's proven to be possible, here's the plan:
Advanced Blocking. It will inject the content script and communicate with it.We may even use the same format for the rules list as Safari uses for the content blockers (maybe they'll support any of these one day lol). Something like this:
{
"css": "div { height: 10px }",
"trigger": {
"if-domain": [ "example.org" ]
}
}
Hi @ameshkov ,
I'm a little confused: will AdGuardForSafari support ext-css and script rules as in the old extension?
@superlex sorry for the delay. No, it does not, and that's what we're going to fix in this issue
Ok, thanks :)
So, should ext-css and script rules continue to stay in Safari filters?
https://github.com/AdguardTeam/FiltersCompiler/issues/27
So, should ext-css and script rules continue to stay in Safari filters?
Sorry for the delay. Yeah, they should stay.
Wow, thank you very much @ameshkov :)
Most helpful comment
Sorry for the delay. Yeah, they should stay.