HACKER Q&A
📣 anigbrowl

Is there a way to stop Google hijacking the URL?


On many pages I visit now, clicking on a search result from google takes me to

https://someurl.tld/page-I-want/#:~:text=Text%20I%20never%20asked%20for

where the appended portion is the text fragment that shows up in Google's search result under the URL. It's incredibly annoying as I'm having to suddenly hand-sanitize every URL if I get it from Google. I use other search engines like DDG where possible but it's not always possible or practical.


  👤 zzo38computer Accepted Answer ✓
I just use this:

  let p=document.evaluate("//a",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
  var w,x;
  for(var i=0;iunescape(z));
    w.setAttribute("href",x.replace(/[?&]?sa=[A-Z]&ved=[-A-Za-z/._0-9+]*$/,""));
  }

👤 oriettaxx
yes, it's well known, and I hate it!

Get rid of that s... with https://github.com/palant/searchlinkfix or similar: every time I install it I have to search pretty hard for that plugin :)


👤 t21u
There are some addons for Firefox to clear the urls. My advice is to not use Google.

👤 throwaway29303
I don't believe it is, your best bet right now is to change to another browser.

👤 thePunisher
Answer: install Firefox.

👤 garlicGum
You could use another search engine. Though, if you really want to use google you can open the article in another tab. That should give you the correct url.