-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add $path modifier of Adguard or any equivalents of this #1690
Comments
We wouldn't need to use Likewise for bing ? |
This works now without having to further complicate the code base and neither have to wait:
|
@gorhill I already fixed the issue and the point is not that I can't address them within the current arsenal. I can fix each case, but every time the rules become more complex and verbose. |
But okay it seems |
I could add a procedural operator like so:
This way implementation becomes quite trivial without having to further complicate the code base for all cosmetic filters. The disadvantage is that this is a procedural cosmetic filters, but it's opened to optimisation, i.e. a filtering engine could have special treatment for such filter in order to have them injected early along with other plain CSS selector-based filters. Also an advantage is that we just keep reusing the same now familiar operator-based approach, which was the entire point of these operators, that is easy to extend with little to no impact on codebase complexity. To calrify "code complexity", the suggested |
Would it be possible to have whitelist approach with |
If argument to Or even |
Sounds great! The reason AG use |
|
Trying to come out with a name I won't feel like changing in the future, please advise. Should it be:
Keep in mind this is the list of supported operators for now: https://github.com/gorhill/uBlock/blob/b44d9219c321cf42379b1b7e8711728321ef0a16/src/js/static-filtering-parser.js#L1818-L1838. Consistency is important. |
Third can be changed to |
Consistency is important. I'm not English-native but it appears |
I am also not English-native, and I wonder whether |
Both are fine, no need to change anything regarding |
Related issue: - uBlockOrigin/uBlock-issues#1690 New procedural operator: `:matches-path(...)` Description: this is a all-or-nothing passthrough operator, which on/off behavior is dictated by whether the argument match the path of the current location. The argument can be either plain text to be found at any position in the path, or a literal regex against which the path is tested. Whereas cosmetic filters can be made specific to whole domain, the new `:matches-path()` operator allows to further narrow the specificity according to the path of the current document lcoation. Typically this procedural operator is used as first operator in a procedural cosmetic filter, so as to ensure that no further matching work is performed should there be no match against the current path of the current document location. Example of usage: example.com##:matches-path(/shop) p Will hide all `p` elements when visiting `https://example.com/shop/stuff`, but not when visiting `https://example.com/` or any other page on `example.com` which has no instance of `/shop` in the path part of the URL.
If you look at the commit, you can see the required changes to the code were very little (even with an opportunistic unrelated change in there), meaning risk of regression is virtually zero -- so I far prefer this approach than supporting a new spec which would require a whole lot of work and assuming I would be fine with all the specs, I would work on this only in a far, undetermined future, with a lot of potential regression (including in performance) as a result. |
@gorhill on Filter To repro add the following filters --
and then visit Am I falling short somewhere ? |
I missed this comment:
So I went with path only, but I will modify to match against path + query. |
Still happens on |
You regex is:
You are escaping the
|
Yeah, need to correct that.
Thanks, works now as expected. |
The |
Yeah, I realised it after I commented, not used to crafting regexes everyday, thanks for helping out. |
You are using invalid syntax.
Exclude
|
Prerequisites
I tried to reproduce the issue when...
Description
AdguardTeam/CoreLibs#124 (comment)
The modifier is useful at least on Japanese sites and
blog.livedoor.jp
is the best example where thousands of different structure of pages share the same domain. This resulted in tons of verbose filters in my personal lists to avoid false positive, otherwise a filter working for a page breaks another page. An actual case reported to me (https://jbbs.shitaraba.net/bbs/read.cgi/internet/25463/1598352715/206
) is thatblog.livedoor.jp###containerWrap > #container > .blog-title-outer + #content.hfeed
made forhttp://blog.livedoor.jp/sexykpopidol/
breakshttp://blog.livedoor.jp/kknao81/
. Currently for this very reason I ignore some ad-placeholder onblog.livedoor.jp
in AdGuard Japanese, which can fully be resolved if the modifier becomes available.(Not worth your time but in
https://blog.livedoor.com/ranking/
you can pick manyblog.livedoor.jp
sites with different structure each.)A specific URL where the issue occurs
blog.livedoor.jp
Steps to Reproduce
NA
Expected behavior
NA
Actual behavior
NA
uBlock Origin version
1.37.2
Browser name and version
Irrelevant
Operating System and version
Irrelevant
The text was updated successfully, but these errors were encountered: