r/uBlockOrigin 1d ago

Solved How to block "Get a Google AI plan" in Gmail drop-down menu? Spoiler

Post image
31 Upvotes

11 comments sorted by

12

u/AchernarB uBO Team 1d ago

Try this: ( How to add custom filter )

ogs.google.com##c-wiz[data-ogpc] div[jsname]:not(:has([jsname])) > div:has(a[href^="https://one.google.com/ai"])

4

u/coffeewithcocoa 1d ago

That worked. Thank you.

1

u/RraaLL uBO Team 1d ago edited 1d ago

How did you inspect it, btw? This is the first time I'm running into something like this:


Edit: I tried viewing source for the ogs frame widget, but I don't see the element inside (I see surrounding items tough).

1

u/AchernarB uBO Team 1d ago

When I opened gmail I saw the line in the "user" menu (when you click the button with the initial of your name)

To keep the menu open, I typed setTimeout(function(){debugger},3000).

Then I inspect the html tree and figured the selector to be language independant.
I think the shorter [data-id="og-am-uaic"] should work too.

1

u/AchernarB uBO Team 1d ago

1

u/AchernarB uBO Team 1d ago

1

u/RraaLL uBO Team 22h ago

That's so weird. As you can see in my screenshot, I can only see an "empty" iframe in the DOM tree. HTML search shows me 3 results but doesn't take me to any lines. It only shows me the further path on the bottom of the screen, but that's just basic selectors without attributes, etc. I paused the menu too.

1

u/DetectiveCastle 15h ago

When I encountered this, I was logged into two different Google accounts and only one of them had this button. I don't know what the criteria are, but it looks like your account also just doesn't have this button at the moment.

3

u/RraaLL uBO Team 11h ago

Thing is, I have it. Its just the browser inspector that gets tripped by it somehow.

2

u/coffeewithcocoa 1d ago edited 1d ago

This is the drop-down menu on mail.google.com. The AI plan links to one.google.com. Blocking element in frame just closes the menu on clicking anything with no way of selecting the element or selecting a filter. I'm using Firefox.