uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.12k stars 767 forks source link

google.com #7960

Closed cantunborn closed 4 months ago

cantunborn commented 4 years ago

URL(s) where the issue occurs

https://www.google.com

Describe the issue

When tapping on the search results, first a google URL is opened and then page is redirected to main search result URL. The link shown after right-clicking (long press on mobile) is also not the URL of search result. This can also be seen in DOM of webpage where the anchor tag a has ping and oncontextmenu (to prevent copying main URL and to replace it with ping URL) attributes which may be considered tracking, but I'm not sure. It definitely is an annoyance since it brings extra redirection and slows down browsing.

Screenshot(s)

I have put screenshots in another issue on adguard filters page https://github.com/AdguardTeam/AdguardFilters/issues/64616.

Versions

Settings

Default settings.

Notes

I bypassed this with google.com##+js(ra, ping|oncontextmenu, a), but it may not be accurate.

necaran commented 6 months ago

Just found a special case where href-sanitizer fails to work.

error

Steps to reproduce:

  1. Start a new profile with Firefox 124.0.1 and install uBlock 1.56.0.
  2. Add the filter: www.google.*##+js(href-sanitizer, #main a[href^="/url?q=http"], ?q)
  3. Disable JavaScript on Google: no-scripting: www.google.com true
  4. Block cookies from Google
  5. Open Console
  6. Search with Google

And there is SecurityError: The operation is insecure.

(
function(name) {
            if ( self.uBO_bcSecret ) { return; }
            const bcSecret = new self.BroadcastChannel(name); // SecurityError: The operation is insecure.

If cookies are allowed, it works just fine under no-scripting mode.

stephenhawk8054 commented 6 months ago

href-sanitizer won't work on desktop. I only set it on mobile

necaran commented 6 months ago

Sorry for the confusion. I added it manually it without any condition, and it does work on desktop. When scripting is disabled for google, it shows the same page as on mobile.

Daxy7 commented 6 months ago

How to truncate URLs like these in Google images? https://www.google.com/search?q=germ+warfare#vhid=gaG-tD5eCpYK3M&vssid=l

https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.goodreads.com%2Fbook%2Fshow%2F45456916-germ-warfare&psig=AOvVaw09bmaCC2rFflAI7lndt44Q&ust=1711917757128000&source=images&cd=vfe&opi=89978449&ved=0CBIQjRxqFwoTCJiZ5dzsnIUDFQAAAAAdAAAAABAE

which should be https://www.goodreads.com/book/show/45456916-germ-warfare https://github.com/uBlockOrigin/uAssets/assets/91396482/05e5cf0d-4c8c-41ad-b7d7-1f80d493b6a5

gwarser commented 6 months ago

uritransform https://github.com/uBlockOrigin/uBlock-issues/issues/3084