Piotr Wu
Piotr Wu

Reputation: 1362

javascript can't use xul's oncommand?

I am writing firefox extension and I am just wondering if is it possible to use xul's 'oncommand' in .js file which I include to this xul. It may sounds stupid but I decided to ask to be 100% sure it's impossible (or possible :))

I can use it in this situation (xul file):

  <toolbarpalette id="BrowserToolbarPalette">
   <toolbarbutton id="quizy-toolbar-button"
      class="toolbarbutton-1 chromeclass-toolbar-additional"
      label="test"
      tooltiptext="test button"
      oncommand="engine.iconCommand()"
   />
 </toolbarpalette>

And in my included .js doesn't work.

 document.oncommand = function(e){
   alert('tango down');
 };

Upvotes: 0

Views: 440

Answers (1)

paa
paa

Reputation: 5054

No, there is no oncommand property (watch bug 246720).

But you can listen for the command event, which is the right way after all.

Upvotes: 3

Related Questions