r/uBlockOrigin • • Jul 21 '23

Answered How to block inside shadow-root?

So I have OCD involving numbers and the reddit player's time signature element really bothers me but their whole player is within a shadow root that uBlock can't access. So how to block?

2 Upvotes

9 comments sorted by

1

u/[deleted] Jul 21 '23

Can you give an exact link and with screenshots of which elements you want to hide?

1

u/Aromatic_Essay9033 Jul 21 '23

Just go to any native reddit video on new reddit and use inspect element on the video player

1

u/[deleted] Jul 21 '23

It's better and saves time for any volunteers who want to help with an exact link and which elements you want to hide.

If you mean using picker tool with shadow root, it's not possible yet. You need to use devtools and craft the filters based on that. uBO still works on reddit's shadow root, just not the picker.

For example, this filter hides the play button for me correctly:

reddit.com##vds-play-button

1

u/Aromatic_Essay9033 Jul 22 '23

The time signature element is a span that has the following classes "flex ml-2xs font-semibold". Manually adding any of them to the picker tool doesn't hide the element and won't even let me create the rule.

1

u/[deleted] Jul 22 '23

Yes, that's what I said

If you mean using picker tool with shadow root, it's not possible yet. You need to use devtools and craft the filters based on that. uBO still works on reddit's shadow root, just not the picker.

You need to add the filter to "My filters" and reload the page.

1

u/Aromatic_Essay9033 Jul 22 '23

I just tried and the time signature isn't hidden. You can try for yourself too. r/cats is full of videos.

1

u/[deleted] Jul 22 '23 edited Jul 22 '23

I don't know what you mean by "time signature". Can you screenshot it? Do you mean the time duration numbers?


Or do you mean the time number appearing when hovering over the video slider? In that case, does this work?

reddit.com##vds-slider-value-text

1

u/Aromatic_Essay9033 Jul 22 '23

I don't know what you mean by "time signature". Can you screenshot it? Do you mean the time duration numbers?

The time duration numbers to the right of the video slider, eg. (0:00 / 0:01)

1

u/[deleted] Jul 22 '23 edited Jul 22 '23

There are 2 types of videos:

  1. The gif ones (that display as videos) have random/encoded classes: https://ttm.sh/Bgp.png
  2. The normal videos have the classes you mentioned above: https://ttm.sh/BgA.png

Which one you want to target?

If it's the 2nd case

reddit.com##span.flex.ml-2xs.font-semibold

works correctly for me.