Can I place my context menu item at the top of the context menu?

I’m looking at writing an extension to copy Chrome’s new tab option in the tab-bar’s context menu (e.g.), but for this to work effectively I would need to add a context menu item to the top of the tab’s context menu. I found the menu’s API and the context type attribute, but cannot find any references to object placement within the context menu.

Is this impossible?

If you mean in WebExtension, that is not possible. The API puts all add-ons’ context-menus at the bottom.

Thanks for the reply. That is frustrating. I guess that leaves me with two options: Patch upstream or go back to Chrome. I use that button too much :confused:

You can probably use the userChrome.css to rearrange the items in the menus.

You can definitely do it with userChrome.css:

#_8b8d1916-2691-454a-acc5-99ed5a748dc0_-menuitem-_bbcwbx\.bbcode {
-moz-appearance: none !important;
-moz-box-ordinal-group: 0 !important;
}

You need to find the css selector for the menu item though.

The ordinal-group number can be any integer, with lower numbers appearing above higher ones, and the default being 1.

1 Like