3 ms·
Ask HN: 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.
- thePunisher 6y agoAnswer: install Firefox.
- garlicGum 6y agoYou 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.
- throwaway29303 6y agoI don't believe it is, your best bet right now is to change to another browser.
- oriettaxx 6y agoyes, it's well known, and I hate it! Get rid of that s... with https://github.com/palant/searchlinkfix https://github.com/palant/searchlinkfix or similar: every time I install it I have to search pretty hard for that plugin :)
- zzo38computer 6y agoI just use this: let p=document.evaluate("//a",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); var w,x; for(var i=0;i<p.snapshotLength;i++) { w=p.snapshotItem(i); x=w.getAttribute("href"); x=x.replace(/^\/url\?q=([^&]*)&.*$/,(y,z)=>unescape(z)); w.setAttribute("href",x.replace(/[?&]?sa=[A-Z]&ved=[-A-Za-z/._0-9+]*$/,"")); }
- t21u 6y agoThere are some addons for Firefox to clear the urls. My advice is to not use Google.