News for hackers. Stuff that matters.
Re:Ask HN: Is there a way to stop Google hijacking the URL? by zzo38computer on Monday June 15, 2020 @07:04PM (#23534100)
I 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+]*$/,""));
  }

There are no comments on this comment yet.