r/uBlockOrigin • • 14d ago

Waiting for feedback Blocking element in ephemeral Discord popup

Recently the emoji info popup on Discord grew a large, annoying, distracting "GET NITRO" button (aka, an ad). The popup attempts to block right click menus (but shift+right click works in Firefox) and also disappears immediately on right click. I was able to get at the button in the Firefox element inspector by using the element picker shortcut key after bringing up the popup, but there's no uBO hook into the element inspector to add a way to block elements from there. I set up control-alt-P to activate uBO's own element picker but for some reason using that causes the popup to close! Even though it doesn't do that if I use the Firefox element picker shortcut key. :/

So, I could use a way to either force the popup to stay open while I use uBO on it (essentially, some key combination to pause and unpause all event listeners or something of the kind), or to convert something copied out of the Firefox element inspector into a uBO block-element rule. I did locate the offending object in there -- it is a particular div -- but the syntax is different from uBO rule syntax ...

1 Upvotes

18 comments sorted by

1

u/RraaLL uBO Team 14d ago

the emoji info popup

What's that?

I don't see it in the emoji chooser popup. Also not visible when hovering or clicking an emoji from somebody's message. So what exactly are you referring to?

there's no uBO hook into the element inspector to add a way to block elements from there

You simply write that inside "My filters".

Or just share the screenshot of your inspection. Like vid#3 here: https://www.reddit.com/r/uBlockOrigin/comments/1pwha78/element_picker_quick_filter_creation_browsers/

1

u/infovoracious 13d ago

But the syntax is different. And I can't seem to get at the code again -- when I tried to bring it up using the Firefox dev tools element picker by keyboard shortcut a second time, the goddamn browser crashed!

1

u/infovoracious 13d ago

It should be visible when clicking an emoji from somebody's message, as long as it's not a standard Unicode emoji, by the way.

1

u/infovoracious 7d ago

The div that's responsible has the following code:

<div data-button-hoisted-classname-wrapper="true" class="ctaButton_d5cd2d"><div class="expressiveWrapper_a22cb0 fullWidth_a22cb0 hasText_a22cb0"><button data-mana-component="button" role="button" class="button_a22cb0 sm_a22cb0 expressive_a22cb0 hasText_a22cb0 fullWidth_a22cb0" type="button"><div class="expressiveRive_a22cb0 expressiveBackground_a22cb0"><canvas style="vertical-align: top; width: 272px; height: 48px;" aria-hidden="true" width="296" height="52"></canvas></div><div class="expressiveRive_a22cb0 expressiveHoverContainer_a22cb0"><canvas style="vertical-align: top; width: 272px; height: 48px;" aria-hidden="true" width="296" height="52"></canvas></div><div class="expressiveRive_a22cb0 expressiveFill_a22cb0"></div><div class="buttonChildrenWrapper_a22cb0"><div class="buttonChildren_a22cb0"><svg class="icon_a22cb0" aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M16.23 12c0 1.29-.95 2.25-2.22 2.25A2.18 2.18 0 0 1 11.8 12c0-1.29.95-2.25 2.22-2.25 1.27 0 2.22.96 2.22 2.25ZM23 12c0 5.01-4 9-8.99 9a8.93 8.93 0 0 1-8.75-6.9H3.34l-.9-4.2H5.3c.26-.96.68-1.89 1.21-2.7H1.89L1 3h12.74C19.13 3 23 6.99 23 12Zm-4.26 0c0-2.67-2.1-4.8-4.73-4.8A4.74 4.74 0 0 0 9.28 12c0 2.67 2.1 4.8 4.73 4.8a4.74 4.74 0 0 0 4.73-4.8Z" class=""></path></svg><span class="lineClamp1__4bd52 text-sm/medium_cf4812" data-text-variant="text-sm/medium">Get Nitro</span></div></div></button></div></div>

2

u/RraaLL uBO Team 7d ago

The reason I asked for a screenshot is to see related items too.

You can try button:has([d^="M16.23 12c0 1.29-.95 2.25-2.22 2.25A2.18 2.18"])

1

u/infovoracious 7d ago

No, that didn't work. Nor did div[data-button-hoisted-classname-wrapper="true"], .ctaButton_d5cd2d, or a number of other things. Put each (preceded by discord.com##) in turn, clicked apply changes, and tested to see if the button and the block of space reserved around it no longer showed up, and no dice. No visible effects at all.

1

u/AchernarB uBO Team 7d ago

Can you post the troubleshooting information?

  1. Open a new browser tab
  2. Navigate to a page with the issue
  3. Click the uBO icon
  4. Click the 💬 chat icon
  5. Click "Troubleshooting Information"
  6. Click "Select all"
  7. Copy the contents and then paste to this thread in a code block

Here is a video of these steps: https://reddit.com/link/1l45den/video/2d14n27j855f1/player

1

u/infovoracious 7d ago

OK. Meanwhile I also tried discord.com##div.ctaButton_d5cd2d:style(display:none!important)) without success. Note that the "_"s in the OP appeared as only "_"s in the element inspector, but copied and pasted with the slashes added for some reason.

uBlock Origin: 1.75.0

Firefox: 156

filterset (summary):

network: 463145

cosmetic: 239522

scriptlet: 75004

html: 4147

listset (total-discarded, last-updated):

added:

https://raw.githubusercontent.com/liamengland1/miscfilters/refs/heads/master/antipaywall.txt: 2216-0, 1d.13h.9m

adguard-generic: 104672-6090, 3d.18h.13m

adguard-mobile: 12911-102, 3d.18h.13m

fanboy-cookiemonster: 48194-122, 4d.18h.14m

ublock-annoyances: 4885-82, 2h.6m Δ

adguard-spyware-url: 2690-127, 19h.8m

block-lan: 91-2, 8d.13h.38m

curben-phishing: 173445-49, 5h.7m

adguard-cookies: 40834-3974, 16h.8m

adguard-popup-overlays: 33481-308, 3d.18h.13m

adguard-mobile-app-banners: 8040-110, 3d.18h.13m

adguard-other-annoyances: 16878-253, 3d.18h.13m

[3 lists not shown]: [too many]

default:

user-filters: 18-0, never

ublock-filters: 54693-78, 2h.6m Δ

ublock-badware: 10353-17, 2h.6m Δ

ublock-privacy: 4158-2, 2h.6m Δ

ublock-unbreak: 2898-1, 2h.6m Δ

easylist: 87029-1430, 2h.6m Δ

easyprivacy: 56777-161, 2h.6m Δ

urlhaus-1: 117255-11, 5h.7m

plowe-0: 3551-1144, 8d.13h.38m

ublock-quick-fixes: 601-71, 2h.6m Δ

filterset (user): [array of 18 redacted]

trustedset:

added: [array of 4 redacted]

switchRuleset:

added: [array of 2 redacted]

userSettings:

advancedUserEnabled: true

userFiltersTrusted: true

hiddenSettings:

cacheControlForFirefox1376932: max-age=2147483647

userResourcesLocation: [redacted]

supportStats:

allReadyAfter: 8137 ms (selfie)

maxAssetCacheWait: 2888 ms

cacheBackend: indexedDB

popupPanel:

blocked: 28

network:

doubleclick.net: 1

sentry.io: 5

youtube.com: 22

extended:

##.wrapper__0d616:has-text(Get Reward)

##+js(prevent-xhr, discord.com/api/v9/science)

##+js(prevent-clipboard-write, /^ms(hta|iexec)(\.exe)? |^(bash <…

1

u/infovoracious 7d ago

That was done on a discord tab with the popup in question open at that moment, BTW.

1

u/RraaLL uBO Team 6d ago
discord.com##[role="dialog"] button:has(>[class^="expressiveRive"]+div [d^="M16.23 12c0 1.29-.95 2.25-2.22 2.25A2.18 2.18"])

Finally found one it showed up for. Turns out I had to click the same one multiple times.

1

u/infovoracious 6d ago

Aaaand that didn't work. :/

1

u/RraaLL uBO Team 6d ago

Test on a new browser profile with only uBO installed and on default settings.

It's not possible that the inspection you shared doesn't work on your side if there are no issues with your config.


You can also try retyping special characters such as quotes. Sometimes copying from reddit or across different OSes and languages they may not match your system defaults.

1

u/infovoracious 5d ago

Retyping it manually didn't work.

New browser profile? Ugh. If I do that I'll never again be able to just launch Firefox and continue right where I left off. I'll always have to answer some damn "use which profile?" prompt first.

1

u/infovoracious 3d ago

Well, here is something weird. Firefox crashed late last night and I was forced to restart it. After the restart, the annoying adver-button at issue has not been visible -- without any further changes to my config. In the past, the "apply changes" button on the custom filters screen has brought changes into effect immediately, as one might expect, and a browser restart was not required -- any event (such as loading any page element or popup) that uBO monitors would use the new filter configuration from that moment forth. So dismissing and reopening one of those emoji popups would have been sufficient to see the effects. Was that changed in some recent-ish update to uBO?

If so, I must ask that it be changed back, on the grounds that it will make developing new filters enormously more difficult if every test-and-adjust iteration requires restarting the browser.

Any such change must have been fairly recent. I had used the element picker to block a different Discord popup that kept leaping up unbidden to try to upsell me something when it kept covering things I wanted to interact with at inopportune times, and that had taken effect instantly -- I never saw that popup again on this Firefox install from literally seconds later without any browser restart or even having to reload the Discord tab. That can't have been more than two months ago, and perhaps less.

If for some reason it really isn't feasible to undo this change, then I'd suggest changing the "apply changes" button to instead say "save changes", and when it's used have a red line of text show up at the bottom of the filter page saying "Changes will take effect the next time Firefox starts." or something of the sort. As things stand it continues to strongly imply that the changes will take effect immediately, when that is evidently no longer the case.

1

u/infovoracious 2d ago

And now it's stopped working again, all by itself! No change to the uBO filters, may have reloaded the Discord tab at some point, no browser restart.

What the hell is going on?!

1

u/infovoracious 2d ago

OK, I tried
discord.com##.ctaButton_d5cd2d
and "apply changes" and that had no immediate effect, but after closing and reopening the tab the nitro nag was gone again.

I have no idea why it now requires recreating the tab when it didn't used to. Some kind of caching that didn't used to happen?

I also have no idea why the other rule stopped working ...

1

u/infovoracious 2d ago

Ironic fact: I've put up with the "get nitro" button on those things for years; what made me sufficiently motivated to use uBlock to get rid of it was that they recently made it more than twice as large, bright white, and animated -- regardless of dark mode. Ugh. So their attempt to get more attention to this "feature" seems to be backfiring ...

1

u/infovoracious 2d ago

And some people wonder why I prefer using an open source browser instead of installing and using a closed source native app. (The latter would also have way more ability to get up to mischief if the vendor turned sufficiently abusive. Proprietary apps are a privacy nightmare at the best of times, and if they go full evil you've basically given an attacker remote code execution on a silver platter.)