How to make a button context menu?

The button context menu is the top line of the menu that I mentioned in the title. MDN only talks about how to make a classic menu (list menu) but no-tutorial for button menu. I wonder why? Isn’t the button menu powerful? Why doesn’t Mozilla open it API to add-ons developers?

You mean the navigation buttons?

Those are pretty hard coded and complicated to properly support adding arbitrary items there. At one point there were plans to make the context menu customizable, where you could re-order it and also move items with an icon to the top etc. However that was never realized and I wouldn’t be surprised if that was due to complexity. The context menu is very complex, with items that are shown, hidden and disabled depending on a variety of conditions.

I never thought it could be that complex. But at some point, I’m still not able to image how much hard code it could be. I mean, what so different between button and list menu that make the button menu a hard code?

It likely is. For instance it only shows you these buttons if you do not right-click on a link.

1 Like