WebExtension - Update tab context menu


#1

Hi, I have a tab context menu with a check-box item, I need to update the the state of this item based on the context tab.
What event can I use to do the update ?


(Niklas Gollenstede) #2

Users can only click stuff in the active window/tab, so these should do:

I’m not sure if you have to listen to the onCreated events as well. And you may have a problem when the user focuses a window by right-clicking it. the menu may show before you were able to process the focus event.


#3

Unfortunately this only allows to update the context menu for the activated tab.
You can right-click on a not activated tab.


(Niklas Gollenstede) #4

Mhm. You want different states for the individual tabs in the tab bar. I don’t think that is possible.
The context only allows you to specify "tab", but not which one. You’ll have to phrase your menu text to say something like “toggle”, or display all possible options and some of them are no-ops.


(Martin Giger) #5

This sounds like yet another use case for https://bugzilla.mozilla.org/show_bug.cgi?id=1215376