Forked from takuya-murao/disable-onmousedown-in-google-search-results-page.user.js
Last active
November 6, 2022 06:08
-
-
Save chris-kwl/6172eb00971ab81bf99a213682b42e21 to your computer and use it in GitHub Desktop.
Disable onmousedown in Google search results page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Disable onmousedown in Google search results page | |
// @namespace https://gist.github.com/chris-kwl/6172eb00971ab81bf99a213682b42e21 | |
// @include http://www.google.tld/search?* | |
// @include https://www.google.tld/search?* | |
// ==/UserScript== | |
(function () { | |
var disableOnmousedown = function (node) { | |
var a, i; | |
var as = node.getElementsByTagName('a'); | |
for (a = as[0], i = 1; a; i++) { | |
a.removeAttribute('data-jsarwt'); | |
a = as[i]; | |
} | |
}; | |
var disableOnmousedownOfInsertedNode = function (evt) { | |
var node = evt.target; | |
var requestURL = evt.newValue; | |
var parentNode = evt.relatedNode; | |
disableOnmousedown(node); | |
}; | |
document.addEventListener('load', disableOnmousedown(document.body), false); | |
document.body.addEventListener('AutoPagerize_DOMNodeInserted', disableOnmousedownOfInsertedNode, false); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment