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

Add support for domain double wildcarding in hiding rules (Would be a huge gamechanger for Nitter) #2905

Closed
8 tasks done
DandelionSprout opened this issue Oct 25, 2023 · 4 comments

Comments

@DandelionSprout
Copy link

DandelionSprout commented Oct 25, 2023

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

Disclaimer: The has-text values in this post are hypothetical, and are very unlikely to match any elements on the example URL page.

While I am well aware that there was wide consensus when domain wildcarding support in hiding rules was added to uBO some years ago, that only one asterisk was allowed, and that it'd be tied to TLDs (e.g. google.*), I've ran into a particular situation where double wildcarding would've made things much easier for me to maintain and test (e.g. nitter.*.*).

As the situation currently stands, My Filters consider e.g. nitter.*.*##.timeline-item:has-text(brony) to be an invalid domain marked in red, so I've had to look at https://github.com/zedeus/nitter/wiki/Instances#public for working instances, then try to view a tweet on each domain shown as working to see if they actually do work (e.g. if PFPs show up, tweet shows up, may later have to test if embeds show up when linked to on Discord), and then use every single confirmed domain in the hiding rule, leading to stuff like nitter.*,nitter.unixfox.eu,nitter.mint.lgbt,nitter.esmailelbob.xyz,nitter.d420.de,nitter.x86-64-unknown-linux-gnu.zip,nitter.woodland.cafe,nitter.dafriser.be,nitter.catsarch.com,nitter.perennialte.ch,nitter.salastil.com,nitter.uni-sonia.com,n.opnxng.com,nitter.ktachibana.party##.timeline-item:has-text(brony), which may possibly have to be re-tested every 4 weeks or so, if not more often.

The way I imagine double wildcarding would work, would be able to compress such entries to the much shorter nitter.*,nitter.*.*,n.opnxng.com##.timeline-item:has-text(brony).

A specific URL where the issue occurs.

https://nitter.mint.lgbt/dril/status/134787490526658561

Steps to Reproduce

  1. Paste nitter.*.*##.timeline-item:has-text(brony) into My Filters.
  2. See that the nitter.*.* part is highlighted in red, and that the parser error claims "Invalid filter: Bad domain name".

Expected behavior

Support for double or multiple wildcarding in hiding rules' domains, and/or any other way to handle mass networks like Nitter, InvidioUS, and Mastodon in one sweep in ways that reduce row lengths and manual list maintenance.

Actual behavior

No such support appears to exist at the moment.

uBO version

1.52.2

Browser name and version

Chrome 118.0.5993.118 x64 stable

Operating System and version

Windows 11 22H2 x64, with all monthly patches that I'm aware of

@gwarser
Copy link

gwarser commented Oct 25, 2023

/^nitter\.[^.]+\.[^.]+$/##.timeline-item:has-text(owned)
   [edit:      ^ - fixed dot escape]

Should be fine in some specialized list. Not sure if tokenization was implemented (it was not initially).

@gorhill
Copy link
Member

gorhill commented Oct 25, 2023

@DandelionSprout Already supported through regex usage.

@gwarser forgot to escape second dot:

/^nitter\.[^.]+\.[^.]+$/##.timeline-item:has-text(owned)

Not sure if tokenization was implemented

Tokenization is only for static network filters, and only for the request URL, not the context one.

@gorhill gorhill closed this as completed Oct 25, 2023
@gorhill
Copy link
Member

gorhill commented Oct 25, 2023

This was added in 1.47.0:

@DandelionSprout
Copy link
Author

Duly noted. I'll make sure to add the RegEx stuff to my syntax info list later tonight. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants