Skip to content
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

Support for cap_html_filtering condition #2259

Open
MasterKia opened this issue Jan 4, 2023 · 2 comments
Open

Support for cap_html_filtering condition #2259

MasterKia opened this issue Jan 4, 2023 · 2 comments

Comments

@MasterKia
Copy link

Issue Details

Similar: #2146

https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#if-condition

Sometimes an annoyance or popup case can be dealt with by either removing the script from that page entirely (HTML filtering) or with the use of scriptlets and it makes sense that the scriptlet rules don't get injected into a page that HTML filtering has already been applied to.

So I use this in my list:

example.com##^script:has-text(BadStuff)
!#if !cap_html_filtering
example.com##+js(FirstScriptlet)
example.com##+js(SecondScriptlet)
example.com##+js(ThirdScriptlet)
!#endif

For AdGuard it can be translated into !#if (!adguard_app_windows && !adguard_app_mac && !adguard_app_android && !adguard_ext_firefox) but it makes sense to have a dedicated condition for this.

Proposed solution

!#if cap_html_filtering

Alternative solution

!#if (!adguard_app_windows && !adguard_app_mac && !adguard_app_android && !adguard_ext_firefox)

@ameshkov
Copy link
Member

We'll also need this in CoreLibs.

@krystian3w
Copy link

krystian3w commented Jan 31, 2024

Maybe should be "delayed" until fix #2646 and reverted these: AdguardTeam/FiltersRegistry#596

I don't think AdGuard Asian users use a list outside the adtidy.org server on a daily basis by:

  • https://subscribe.adblockplus.org/?location=1&title=2
  • abp:subscribe?location=1&title=2
  • abp://subscribe?location=1&title=2

share mechanism (as HTML links).


Note

A little off-topic:

It is definitely worth analyzing whether the AdGuard domain (or IP range) is banned in some countries periodically or permanently for years.

Iz-zzzzz added a commit to Iz-zzzzz/IzFilter-Public that referenced this issue Jun 9, 2024
- drop a support for AdGuard (Waiting for issues to be resolved)
See more: 
1. $generichide modifier prevents other rules($doc, network request .etc) to work correctly - AdguardTeam/AdguardBrowserExtension#2690
2. AdGuard on Firefox doesn't parse filters inside an !#if cap_html_filtering directive of custom rules (but User rule does) - AdguardTeam/AdguardBrowserExtension#2259
3. Some of HTML Filtering rules can break site - AdguardTeam/AdguardBrowserExtension#2646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants