I have a context menuitem which is activated if an image is right-clicked, the exact same way that 'context-copyimage'
is activated.
Is it possible to tie/pair that menuitem to the 'context-copyimage'
therefore eliminating the need to add extra (duplicate) event-listeners and show/hide handlers??!!
(Adding an observer to 'context-copyimage'
defeats the purpose)
If not, is it possible to use the event-listener that 'context-copyimage'
uses?
Update:
I am trying to reduce listeners. At the moment, script has a popupshowing
listeners. On popupshowing
, it checks for gContextMenu.onImag
and if true, it shows the menuitem. Firefox's context-copyimage
does the exact same thing. I was wondering if it was possible to tie these 2 in order to remove/reduce the in-script event listeners.
I was also chatting with Dagger and he said that:
... the state of built-in items isn't set from an event handler, it's set from the constructor for nsContextMenu, and there are no mechanisms to hook into it
So it seems, that is not possible