Adding some advanced features to WebRunner
Posted July 14th, 2007 by 20after4
This is a quick and dirty copy-paste hack to get Password Manager and "about:config" functionality in webrunner 0.5: You will need to modify two files in the chrome/content directory as follows... Inside the statusbar tag in webrunner.xul (line 51) add the following:
<statusbarpanel id="statusbar-tools" label="">
<toolbarbutton type="menu">
<menupopup id="tools-popup">
<menuitem id='menu_config' label='Advanced Config' oncommand="menuCommand('cmd_config');"/>
<menuitem id='menu_passwordmanager' label='Password Manager' oncommand="menuCommand('cmd_passwordmanager');"/>
<menuitem id='menu_jsconsole' label='JavaScript Console' oncommand="menuCommand('cmd_jsconsole');"/>
</menupopup>
</toolbarbutton>
</statusbarpanel>
And add this to the end of webrunner.js:
/* advanced tools menu handler added by Mukunda Modell */
function menuCommand(cmd) {
var winUrl;
var features;
if(cmd == 'cmd_config') {
//show about:config (Advanced config)
winUrl = "chrome://global/content/config.xul";
features = "chrome,statusbar=yes,titlebar=yes,centerscreen,close=yes,modal=yes";
window.open(winUrl,"About:Config",features);
} else if (cmd == 'cmd_passwordmanager') {
//show Password Manager dialog
winUrl = "chrome://passwordmgr/content/passwordManager.xul";
features = "chrome,statusbar=yes,titlebar=yes,close=yes,modal=yes";
window.open(winUrl,"About:Config",features);
} else if (cmd == 'cmd_pref') {
winUrl = "chrome://webrunner/content/prefs.xul";
features = "chrome,titlebar,toolbar,centerscreen,modal";
window.openDialog(winUrl, "Preferences", features);
} else if (cmd == 'cmd_jsconsole') {
toJavaScriptConsole();
}
}
Note: there is code to support JavaScript console, however, this is not working for me on Linux with the latest nightly builds of xulrunner. It should work on OS X though it might just be an issue with the default preferences. I will post an update here when I get it figured out. Enjoy!Related Project:
WebRunnerX
