Prerequisites
Description
A steadily higher amount of websites are using randomly generated class names for elements, and a slight majority of such websites also keeps changing those generated class names every month-ish. However, I think I've discovered one thing that can help select specific such elements at least a bit more easily:
On a few of the websites in question, with Twitter and Pixiv as the biggest examples that I personally know of, the amount of classes the elements have are different, and they seem to be fairly consistent.
My wish is that in the setting of the screenshot below, <div class="sc-1nr368f-4 ez9z4y-0 cIk0oy"> would've been selectable with ##div:classes(3), or whatever else you'd want to name it (e.g. :class-number). Likewise it would be selectable with ##div:classes(2) > div:classes(3), and perhaps even ##div:classes(3):has(:scope > section:classes(2)).

Currently, it seems that ##div[class*=" "] can cover everything with 2 or more classes, but I can't find any ways to make it more narrowed-down than that.
An alternative could be to add wildcard support for id and class (e.g. ###*.*.*), similar to what I am currently only able to do with singular elements (e.g. ##*)
A specific URL where the issue occurs
https://www.pixiv.net/en/tags/princess_dress/illustrations (If you're not logged in.)
https://www.pixiv.net/en/tags/princess_dress/illustrations?mode=safe (If you're logged in.)
Steps to Reproduce
- Visit whichever website, although preferably one with many different class-containing elements.
- Open the element picker.
- Attempt to add
##.*, ##div:classes(1) and/or ##div:class-number(1), and see that none of them are accepted.
- Attempt to add
##div[class*=" "][class*=" "], and see that the amount of successive [class*=" "] has no narrowing-down effect on what is being selected.
Expected behavior:
It becomes possible to select and hide elements based on the amount of classes they have.
Actual behavior:
Currently this can only be done for elements with 0 classes (##div:not([class])) and 1 class (##div[class]:not([class*=" "]). There are currently no known way to specifically select elements by the exact amount of classes they have, if that number is 2 or higher.
Your environment
- uBlock Origin version: 1.29.0
- Browser Name and version: Vivaldi 3.2.1967.41 x64
- Operating System and version: Windows 10 May 2020 Update
Prerequisites
Description
A steadily higher amount of websites are using randomly generated class names for elements, and a slight majority of such websites also keeps changing those generated class names every month-ish. However, I think I've discovered one thing that can help select specific such elements at least a bit more easily:
On a few of the websites in question, with Twitter and Pixiv as the biggest examples that I personally know of, the amount of classes the elements have are different, and they seem to be fairly consistent.
My wish is that in the setting of the screenshot below,
<div class="sc-1nr368f-4 ez9z4y-0 cIk0oy">would've been selectable with##div:classes(3), or whatever else you'd want to name it (e.g.:class-number). Likewise it would be selectable with##div:classes(2) > div:classes(3), and perhaps even##div:classes(3):has(:scope > section:classes(2)).Currently, it seems that
##div[class*=" "]can cover everything with 2 or more classes, but I can't find any ways to make it more narrowed-down than that.An alternative could be to add wildcard support for id and class (e.g.
###*.*.*), similar to what I am currently only able to do with singular elements (e.g.##*)A specific URL where the issue occurs
https://www.pixiv.net/en/tags/princess_dress/illustrations(If you're not logged in.)https://www.pixiv.net/en/tags/princess_dress/illustrations?mode=safe(If you're logged in.)Steps to Reproduce
##.*,##div:classes(1)and/or##div:class-number(1), and see that none of them are accepted.##div[class*=" "][class*=" "], and see that the amount of successive[class*=" "]has no narrowing-down effect on what is being selected.Expected behavior:
It becomes possible to select and hide elements based on the amount of classes they have.
Actual behavior:
Currently this can only be done for elements with 0 classes (
##div:not([class])) and 1 class (##div[class]:not([class*=" "]). There are currently no known way to specifically select elements by the exact amount of classes they have, if that number is 2 or higher.Your environment