This is done in a function that is invoked during window.onload, defined in the javascript file that is tagged in my overlay XUL file's script tag.
I keep getting 'command id' is not an element in the console.
This is the XUL snippet -
Code: Select all
<overlay id="browser-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://myext/content/init.js" />
<commandset>
<command id="CmdOptions"/>
</commandset>
<!--other stuff--->
</overlay>
Code: Select all
showOptions: function() {
Console.log('show options has run.');
},
init : function(){
document.getElementById("CmdOptions").setAttribute('oncommand','showOptions();');
}
window.addEventListener("load", PureURL.Launch.init(),false);