Closed Bug 1211368 Opened 4 years ago Closed 4 years ago

Implement missing features for contextMenus


(WebExtensions :: Untriaged, defect)

Not set


(Not tracked)



(Reporter: gkrizsanits, Unassigned, Mentored)


(Blocks 1 open bug)


(Whiteboard: [contextMenus])

Some features are still missing:

- onBeforeShow (see Bug 1190667 Comment 2)
- radio buttons / checkboxes
- event page version
- icon
Whiteboard: [contextMenus]
Not chrome conform, but maybe possibilities to hide context menu items and create own submenus would be nice. Also we should have a possibility to decide if we want to have "one menu" with more as one item or not.
Also it is currently not possible to decide according web content for e.g. a DIV with a special classname, if an item should be displayed or not (if it is not a url or a image or whatever for a standard HTML element) -> custom elements with check for properties are needed.

At the moment i use the "mousedown" event for a a precheck of the target element, send a message to backgound and create the context menu at this time. It is also not able to use the "contextmenu" event, because it is all async and the new context menu item is not fast enough created so the item would only be visible at 2nd click. This was no problem on my bootstrap addon with a framescipt. So the performance of Webextensions seems to be worse as the old style fx addons.

Last but not least the in opposite to my old style bootstrap addon with framescript the eventlistener fires not on iframes because it is settled to the main document in WE and not to the ContentFrameMessageManager. With bootstrap  addons with framesscripts it was fired on main documents and iframes.
I already mentioned the async race condition in Google Chrome and it is linked in Comment 1.

I consider this feature broken without proper onBeforeShow support for content->chrome communication.
Splitting this into three separate bugs, per discussion in triage. Please continue these discussions in the appropriate new bugs.
Closed: 4 years ago
Depends on: 1215377, 1215376, 1215375
Resolution: --- → INVALID
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.