Skip to content

Instantly share code, notes, and snippets.

@ETiV
Last active December 19, 2015 00:09
Show Gist options
  • Save ETiV/5866623 to your computer and use it in GitHub Desktop.
Save ETiV/5866623 to your computer and use it in GitHub Desktop.
去掉 Google 搜索结果页的跳转
// ==UserScript==
// @name 去掉Google搜索跳转
// @namespace ETiV
// @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(){
//console.log('remove action:',++count2);
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