Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-kwl/6172eb00971ab81bf99a213682b42e21 to your computer and use it in GitHub Desktop.
Save chris-kwl/6172eb00971ab81bf99a213682b42e21 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/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