Live data from Hacker News

Prevent Google from mangling search result links when click/copying on Firefox

gist.github.com

11–20 of 203 posts

Re: Prevent Google from mangling search result links when click/copying on Firefox

#11
Google does this so they have click tracking data. But they don't need to mangle URLs in Chrome because it supports the `ping` attribute on tags [0].

The ping attribute basically adds click tracking as a native browser feature so you don't need to do URL redirects. It also makes these analytics much easier for the site and mysterious to the user. Looks like most vendors besides Firefox support it. (They were pretty opposed I recall)

If you're a Chrome user, there's some extensions that disable ping requests/link auditing [1]. (EDIT: a commenter noted that uBlock Origin already blocks these! So I recommend that over this obscure extension)

[0] https://caniuse.com/ping

[1] https://chrome.google.com/webstore/detail/ping-blocker/jkpoc...

Re: Prevent Google from mangling search result links when click/copying on Firefox

#12
While this might solve the problem for the Google search engine it is but a patch to a bigger problem. Instead of applying this patch on each and every device you happen to use it is much more effective to refrain from using these search engines directly by using a meta-search engine like Searx [1]. This not only solves these obnoxious attempts at leaching a bit more data from you, it has an even bigger advantage: it shows search results from multiple engines, ranked in the way those engines present the results to an anonymous user. This often reveals interesting patterns by showing just how those who run these search engines either promote or demote relevant results for a given search. Google clearly prefers to show results from corporate media and established actors (e.g. Wikipedia) above those from non-affiliated sites, DuckDuckGo gives far more 'organic' results.

[1] https://searx.me

Re: Prevent Google from mangling search result links when click/copying on Firefox

#13

There's already an add-on which does this, and more. https://addons.mozilla.org/en-CA/firefox/addon/clearurls/

I actually prefer short userscripts like this over addons, because I can immediately see it's not doing anything nefarious and I only need to trust the addon that I install the user script with.

Same here.

Re: Prevent Google from mangling search result links when click/copying on Firefox

#14
post #11

Google does this so they have click tracking data. But they don't need to mangle URLs in Chrome because it supports the `ping` attribute on tags [0]. The ping attribute basically adds click tracking as a native browser feature so you don't need to do URL redirects. It also makes these analytics much easier for the site and mysterious to the user. Looks like most vendors besides Firefox support it. (They were pretty o…

Firefox has a browser.send_pings setting to control this, not sending any pings when it is set to false. This is explicitly a valid browser implementation of the ping attribute:

https://html.spec.whatwg.org/multipage/links.html#hyperlink-...

> 2. Optionally, return. (For example, the user agent might wish to ignore any or all ping URLs in accordance with the user's expressed preferences.)

The problem isn't that Firefox doesn't support the ping attribute, the problem is that Google fails to respect user requests not to track.

Re: Prevent Google from mangling search result links when click/copying on Firefox

#15
To add a little color and for clarity:

Some google links (notably shopping links for products) don't just point at a google-owned redirect (presumably for ad tracking/payment calculation?), they also change the link target on click (?!?evil!?!). There are redirect-removal addons which re-write the original URL correctly, but the on-click handlers mangle the target of the link if the event is not blocked.

Re: Prevent Google from mangling search result links when click/copying on Firefox

#16
post #11

Google does this so they have click tracking data. But they don't need to mangle URLs in Chrome because it supports the `ping` attribute on tags [0]. The ping attribute basically adds click tracking as a native browser feature so you don't need to do URL redirects. It also makes these analytics much easier for the site and mysterious to the user. Looks like most vendors besides Firefox support it. (They were pretty o…

The ping attribute is blocked by uBlock Origin. It's called hyperlink auditing in the dashboard.

Re: Prevent Google from mangling search result links when click/copying on Firefox

#17
post #11

Google does this so they have click tracking data. But they don't need to mangle URLs in Chrome because it supports the `ping` attribute on tags [0]. The ping attribute basically adds click tracking as a native browser feature so you don't need to do URL redirects. It also makes these analytics much easier for the site and mysterious to the user. Looks like most vendors besides Firefox support it. (They were pretty o…

I don’t want my clicks to be tracked!

Re: Prevent Google from mangling search result links when click/copying on Firefox

#18
post #11

Google does this so they have click tracking data. But they don't need to mangle URLs in Chrome because it supports the `ping` attribute on tags [0]. The ping attribute basically adds click tracking as a native browser feature so you don't need to do URL redirects. It also makes these analytics much easier for the site and mysterious to the user. Looks like most vendors besides Firefox support it. (They were pretty o…

For Firefox, there's a relatively popular extension called ClearURLs that sanitizes most URLs to remove tracking, including Google's and Amazon's.

Re: Prevent Google from mangling search result links when click/copying on Firefox

#19
post #11

Google does this so they have click tracking data. But they don't need to mangle URLs in Chrome because it supports the `ping` attribute on tags [0]. The ping attribute basically adds click tracking as a native browser feature so you don't need to do URL redirects. It also makes these analytics much easier for the site and mysterious to the user. Looks like most vendors besides Firefox support it. (They were pretty o…

It’s also a notable DDoS amplification vector[1].

[1]: https://securityaffairs.co/wordpress/83890/hacking/ddos-html...

Re: Prevent Google from mangling search result links when click/copying on Firefox

#20

There's already an add-on which does this, and more. https://addons.mozilla.org/en-CA/firefox/addon/clearurls/

I actually prefer short userscripts like this over addons, because I can immediately see it's not doing anything nefarious and I only need to trust the addon that I install the user script with.

> I only need to trust the addon that I install the user script with

I wonder why this is even necessary. User scripting should be a standard feature of browsers. We should have direct access to a complete Javascript environment every time we launch a browser. Just like Emacs gives users a Lisp environment.

Post reply on HN