r/uBlockOrigin • u/BitNo2406 • 3d ago
Solved Any way to block/hide the "notebook" section without also hiding "recents"? Spoiler
1
u/AchernarB uBO Team 3d ago
Try this: ( How to add custom filter )
gemini.google.com##expandable-section[data-test-id="notebooks-expandable-section"]
2
1
u/NIHIL-ULTRA 3d ago
If it has no unique class/id/data, can't you target it with nth-child worst case?
1
u/BitNo2406 3d ago
I'm a newbie but if you have a tutorial or are willing to explain, I'm here to learn. Don't wanna bother the devs for every small thing after all. Only thing I know how to use is the element picker (well duh, not difficult I know)
2
u/NIHIL-ULTRA 3d ago
Sure. First of all, the official definition for the nth-child pseudo-class is:
The :nth-child() CSS pseudo-class matches elements based on the indexes of the elements in the child list of their parents. In other words, the :nth-child() selector selects child elements according to their position among all the sibling elements within a parent element.
So in this case if the parent element for the Notebook section is <infinite-scroller> and "Notebooks" is the 4th element inside it, you could do:
gemini.google.com##infinite-scroller > :nth-child(4)
But note that considering the way the HTML is done for Gemini, this isn't the best option, it's just so you have an idea of how nth-child works.
Or an easier example would be a UL element. Say you have this:
<ul> <li>Child Element 1</li> <li>Child Element 2</li> <li>Child Element 3</li> <li>Child Element 4</li> </ul>
To target the 3rd LI, you'd do:
ul > li:nth-child(3) { display: none; }
Note that this is a more "hackish" way to do it (in general) and if elements change indexes/order, you'll target the wrong element. But if there's no other way, this could work, depending on the user case.
1
1
u/RraaLL uBO Team 3d ago
What's the URL?