Skip to content

Instantly share code, notes, and snippets.

@edvakf
Created April 6, 2011 12:04
Show Gist options
  • Select an option

  • Save edvakf/905538 to your computer and use it in GitHub Desktop.

Select an option

Save edvakf/905538 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @include http://fastladder.com/reader/
// @include http://reader.livedoor.com/*
// ==/UserScript==
window.opera.addEventListener('BeforeScript',function(e){
if (parseFloat(window.opera.version()) < 11.10) return;
if ((window.location.href.indexOf('http://reader.livedoor.com/') === 0 &&
e.element.src.indexOf('reader_main') > 0) ||
(window.location.href.indexOf('http://fastladder.com/') === 0 &&
e.element.text == 'init();')) {
window.HotKey.prototype.init = function(){
var self = this;
var target = this._target;
var keypress_listener = function(e){
if(!self.active) return;
self.globalCallback();
if(e.metaKey || e.altKey) {return}
self.event = e;
var input = self.get_input(e);
if(self.lastCapture != "keydown" || self.lastInput != input){
self.lastInput = input;
self.lastCapture = "keypress";
self.invoke() && Event.stop(e);
}
};
this._ctor.register_keylistener("keypress", keypress_listener, self);
};
}
},false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment