How can I catch file > print event in Firefox add-on?

I want to create a Firefox add-on with which I catch the "file > print" browser event for stop it. Does anyone know how to catch this event? I find in browser.xul file the command:

   <command id="cmd_print" oncommand="goDoCommand('cmd_print')"/>

Can I catch goDoCommand('cmd_print') event?

Upvotes: 1

Views: 155

Answers (1)

Mike Kaply
Mike Kaply

Reputation: 745

An easier thing to do would be to simply overlay the command so it does nothing.

In your XUL overlay, do this:

<commandset id="mainCommandSet">
  <command id="cmd_print" oncommand=""/>
</commandset>

This should cause nothing to happen when cmd_print is executed.

Upvotes: 1

Related Questions