Skip to content

Instantly share code, notes, and snippets.

@miya2000
Created May 13, 2011 17:03
Show Gist options
  • Save miya2000/970897 to your computer and use it in GitHub Desktop.
Save miya2000/970897 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Booooooooogle
// @include http://www.google.co.jp/*
// @include http://www.google.com/*
// ==/UserScript==
(function() {
opera.addEventListener('BeforeEvent', function(e) {
if (e.event.type == 'keypress' && e.event.keyCode == 13) {
e.preventDefault();
}
else if (e.event.type == 'submit' && e.event.target.name == 'f') {
e.preventDefault();
}
}, true);
opera.addEventListener('BeforeEvent.click', function(e) {
var ele = e.event.target;
while (ele) {
if (ele.nodeName == 'A') break;
ele = ele.parentNode;
}
if (ele) {
e.preventDefault();
}
}, true);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment