Skip to content

Instantly share code, notes, and snippets.

@math2001
Created March 18, 2017 06:08
Show Gist options
  • Save math2001/4fbdaf2419ba0736a33b8e2c5834497e to your computer and use it in GitHub Desktop.
Save math2001/4fbdaf2419ba0736a33b8e2c5834497e to your computer and use it in GitHub Desktop.
Prevents google result links from redirecting you to an other url which then redirects you to the actual result

Just add it using an extension like User CSS and Javascript for google chrome

document.body.addEventListener('mousedown', (e) => {
if (!(e.target.nodeName == 'A' && e.target.parentElement.nodeName == 'H3')) {
return
}
e.stopImmediatePropagation()
e.stopPropagation()
e.target.href = e.target.getAttribute('data-href')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment