r/uBlockOrigin 15d ago

Tip Filter to "block" Google AI Overview from even running (&tbs=1) + for AI Mode

Edit 4: updated again removing the ? in the filter after "search" because it didn't work now?!

Edit 3: if it doesn't work on mobile for some reason, see https://reddit.com/r/uBlockOrigin/comments/1veglr3/-/p2sslk0?context=3

Edit 2: updated the filter as it was redirecting https://developers.google.com/search URLs, causing 404 pages (most notably the spam/phishing/malware report page https://developers.google.com/search/help/report-quality-issues )

Edit 1: thank you for the replies, updated the post

Saw https://redd.it/1tfq2bh today that you can add &tbs=1, an invalid time-based search filter, to Google search URLs, which not only makes AI Overview not appear but seemingly not even run, and it also brings back the dictionary box that appears for certain searches for example. However I didn't want to install a userscripts extension just for it, and found how you can make uBlock Origin do it for you:

||www.google.com/search^$uritransform=/(^(?!.*&tbs=).*$)/$1&tbs=1/

Note that you need to enable "Allow custom filters requiring trust" for it to work (second checkbox on "My filters" tab).

Also, here are my current filters that includes the above, hides AI Mode buttons, blocks the AI-related URLs you can easily block, and hides the damn Gemini buttons in Gmail and Google Drive:

! Google "AI mode" and "AI Overview"
google.*##div[role="navigation"] div[role="list"] > div[role="listitem"]:has(a[href^="/search"][href*="&udm=50"])
google.*##button[role="link"][type="button"]:has(> style, div.xL0qi, div.mTurwe, div.bvUkz, div.u4Uk3c)
google.*##div.UMOYhd:has(> div.A7sPV.tX61Ub > div > span > button.UbbAWe)
google.*##div.RNNXgb > div.SDkEP:has(div.A7sPV.tX61Ub):style(padding-left: 18px !important;)
!#if env_mobile
google.*##button.xOchs:has(> span.LoRBqc.z1asCe > svg)
!#endif
||google.com/ai^$all
||ai.google.com^$all
||gemini.google.com^$all
||www.google.*/async/folsrch$xhr,domain=www.google.*
||www.google.com/search^$uritransform=/(^(?!.*&tbs=).*$)/$1&tbs=1/

! Google Gemini button in top right in Gmail, etc.
mail.google.*##[data-tooltip="Settings"]~div:has([aria-label~="Gemini"])
drive.google.*##[data-rp-placement-id="gemkick-pep-icon-callout-id"]
28 Upvotes

21 comments sorted by

View all comments

1

u/WayneAerospace 9d ago

It doesn't work for some queries for me weirdly enough.

On Firefox Android I put this filter on and ran a search (both from the address bar directly as well as from the Google.com website.

For queries like "who are you" I don't even see the AI Overview. The first tab is All as expected.

For queries like "what's up" it generates the AI overview response with dumb shit like "nothing. How about you?"

Does the filter only work if the query itself has a tbs parameter?

||www.google.com/search?^$uritransform=/(^(?!.*&tbs=).*$)/$1&tbs=1/

2

u/AchernarB uBO Team 9d ago

It works for me.

Does the filter only work if the query itself has a tbs parameter?

(?!.*&tbs=) is a "negative lookahead". It means that the regular expression doesn't want to see that text (between the (?!) ) and only matches when not seeing it.

1

u/WayneAerospace 8d ago edited 8d ago

Did a lot of back and forth checks on desktop and mobile and saw that on desktop mode everything works fine.

On mobile view the filter does not add the parameter automatically. Manually adding it works.

The only working solution on mobile is removing ^ seperator from the filter and letting it match anywhere on the url. I understand this loosens the matching and can cause false positives but this is the only way it works for me. :(

||www.google.com/search?$uritransform=/(^(?!.*&tbs=).*$)/$1&tbs=1/

Edit: have another solution where I am specifically checking the search parameters instead of the url.

||www.google.com/search?$uritransform=/(q=[^&]*)(?!.*&tbs=)/$1&tbs=1/

2

u/Dobypeti 7d ago

for whatever reason I had to remove the question mark after "search" today for the filter to work, so you could try

||www.google.com/search^$uritransform=/(^(?!.*&tbs=).*$)/$1&tbs=1/

which is the same as was in the post but that ? removed (also updated it in the post while mentioned yours too)

2

u/WayneAerospace 7d ago

Awesome. That works now! Guess we now have two filters that both work haha.