endflow.net blog

/* programming and programming */

Archive for July, 2008

RTM keyconfig update for Firefox 3

with 2 comments

/* RTM keyconfig */

I’ve updated RTM config for Firefox 3 + Greasemonkey 0.8.
There is no change of user confg and feature.

rtm_keyconfig.user.js [userscript.org]

/* Causes */

In previous version (0.1.2), It generates the code from user config, makes function (global scope) object and registers it into event handler of EventManager class. However, This code occurs some errors. So I can’t fix this issue.

EventManager.prototype.bodyKeyPressHandler = new Function("ev", "ignoreCombo", newcode);

Recently, I pinpointed the causes that “new Function(…)” occurs error. Therefore, I decide to insert script tag include generated code from user config into html. Like this:

var script = document.createElement('SCRIPT');
script.innerHTML = 'function gm_rtm_keyconfig(ev, ignoreCombo){n' + newcode + 'n}';
document.getElementById('content').appendChild(script);
eventMgr.bodyKeyPressHandler = function(ev, ignoreCombo){
    gm_rtm_keyconfig.call(eventMgr, ev, ignoreCombo);
};

/* Conclusion */

Thank you Ofer.
I can’t fix this issue without your comment.

enjoy RTM! ;)

Written by kuy

July 5th, 2008 at 3:02 am

Posted in Uncategorized

Tagged with , , ,