Skip to content

Instantly share code, notes, and snippets.

@solos
Created May 23, 2014 03:53
Show Gist options
  • Save solos/8d75ee9c6971e65daca5 to your computer and use it in GitHub Desktop.
Save solos/8d75ee9c6971e65daca5 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name 去掉Google搜索跳转
// @namespace Google
// @include https://www.google.co*
// @include http://www.google.co*
// @grant GM_setValue
// @version 1
// ==/UserScript==
document.addEventListener('DOMNodeInserted', checksearch, false);
function checksearch() {
var list = document.getElementById('ires');
if (list) {
document.removeEventListener('DOMNodeInserted', checksearch, false);
document.addEventListener('DOMNodeInserted', clear, false)
};
}
function clear() {
var items = document.querySelectorAll('a[onmousedown]');
for (var i = 0; i < items.length; i++) {
items[i].removeAttribute('onmousedown');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment