On a google search page, if I right-click a URL and copy the URL, I will not copy the original URL by a google altered URL like the following
Is there a way to block this from happening?
On a google search page, if I right-click a URL and copy the URL, I will not copy the original URL by a google altered URL like the following
Is there a way to block this from happening?
Yes. The link is changed when you interact with it. If you right-click on it, you will it see it change. The actual url is encoded in a parameter at the end.
So there are at least two solutions: one is to avoid having the link changed in the first place (for example with Google Search link fix the other is to decode it afterwards (for example with Clean Links).
Google Chrome:
In the most recent versions of Chrome (at least as far back as late 2018), you shouldn't be seeing this behaviour anymore. Google has replaced the modified URLs with the "ping" attribute - essentially the same tracking, but more user friendly.
Example (from the search results for "super user") - notice the ping="/url...
part:
<a href="https://superuser.com/" ping="/url?sa=t&source=web&rct=j&url=https://superuser.com/&ved=2ahUKEwjn--HRg_PkAhVRIVAKHZRGDBUQFjAAegQIBBAB">
If your don't like this kind of sneaky tracking either, you can get rid of it with a browser extension such as Privacy Badger. But well, you're still using Google's browser...
Firefox
In Firefox, and probably all other non-Chromium browsers, you still get the modified links as described in the question. Now, the problem here is that they're created via client-side javascript triggered by onmousedown
event.
This is what a search result looks like before you click the link:
<a href="https://superuser.com/" onmousedown="return rwt(this,'','','','1','AOvVaw3z0-wV2Li62qFFF2yyoNpP','','2ahUKEwiPodzJiPPkAhWVXhUIHeJgCFEQFjAAegQIBBAB','','',event)">
When you click it (including right-clicking to copy the URL), it immediately changes to
<a data-cthref="/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=2ahUKEwiPodzJiPPkAhWVXhUIHeJgCFEQFjAAegQIBBAB&url=https%3A%2F%2Fsuperuser.com%2F&usg=AOvVaw3z0-wV2Li62qFFF2yyoNpP" href="/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=2ahUKEwiPodzJiPPkAhWVXhUIHeJgCFEQFjAAegQIBBAB&url=https%3A%2F%2Fsuperuser.com%2F&usg=AOvVaw3z0-wV2Li62qFFF2yyoNpP" onmousedown="return rwt(this,'','','','1','AOvVaw3z0-wV2Li62qFFF2yyoNpP','','2ahUKEwiPodzJiPPkAhWVXhUIHeJgCFEQFjAAegQIBBAB','','',event)">
Since this is achieved by javascript, there's probably no native Firefox setting that would prevent this (please correct me if I'm wrong). However, as others have pointed out, there are multiple browser extensions which can be used to stop this behaviour.
Further reading:
Privacy Badger Now Fights More Sneaky Google Tracking
Note: I am not affiliated with Privacy Badger or the EFF in any way, except as a user of the browser extension.