I am attempting to write a filter for uBlock Origin that hides a text node (the visible text) inside an HTML DOM element. For example, take the following HTML:
(HTML Based on the Adblock Help Center)
I can target the SVGs with example.com##button > .sparkle or example.com##button > .dropdown, but the text node doesn't have an element name or attributes to target. I've tried the following approaches:
! No effect
example.com##button::target-text
example.com##button > ::target-text
! Also hides SVGs inside button
example.com##button {content-visibility: hidden}
How can I hide the text content inside the button without hiding the other child elements?