Skip to content

Instantly share code, notes, and snippets.

@starenka
Created January 20, 2011 13:59
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 starenka/787909 to your computer and use it in GitHub Desktop.
Save starenka/787909 to your computer and use it in GitHub Desktop.
Opera - gimme my slash back
/*
* This is Opera user script, place me into ~/.opera/scripts
* You can read more about userjs here http://www.opera.com/docs/userjs/
*
* This listener prevents events fired after keypress.
* Feel free to add more scancodes into the regexp.
* 47 - slash
*
* @author starenka
* @version 0.1
* @since 20-01-2011
*/
window.opera.addEventListener('BeforeEventListener.keypress', function (ev){
if(/^(47)$/.test("" + ev.event.keyCode)) ev.preventDefault();
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment