Skip to content

Instantly share code, notes, and snippets.

@isayme
Created August 13, 2014 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isayme/aba8b5cb08423a5b2fd9 to your computer and use it in GitHub Desktop.
Save isayme/aba8b5cb08423a5b2fd9 to your computer and use it in GitHub Desktop.
油猴脚本 => 禁止点击Google搜索结果的跳转.
// ==UserScript==
// @name noGoogleRedirect
// @namespace http://www.onefloweroneworld.com
// @description 禁止点击Google搜索结果的跳转.
// @include http://www.google.com/search?*
// @include https://www.google.com/search?*
// @version 0.1
// @author iSayme <isaymeorg@gmail.com>
// @run-at document-end
// @grant none
// ==/UserScript==
var removeMouseDown = function() {
var items = document.querySelectorAll('li.g h3.r a');
for(var i = 0, l = items.length; i < l; i++) {
items[i].removeAttribute('onmousedown');
}
}
var s = document.createElement('script');
s.setAttribute('type', 'text/javascript');
s.appendChild(document.createTextNode('(' + removeMouseDown + ')()'));
document.getElementsByTagName('head')[0].appendChild(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment