Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save takuya-murao/3081371 to your computer and use it in GitHub Desktop.
Save takuya-murao/3081371 to your computer and use it in GitHub Desktop.
Disable onmousedown in Google search results page
// ==UserScript==
// @name Disable onmousedown in Google search results page
// @namespace https://gist.github.com/3081371
// @include http://www.google.*/search?*
// @include https://www.google.*/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('onmousedown');
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