The Firefox Extension Addon SDK combines several action buttons,

I want to combine the two "Action Buttons" into one, just as Firefox currently does with their Bookmarks add-on, notices that it is considered as one button in the "Configure ..." settings.

Here is a screenshot of the entire button on navBar.

Here is what the button looks like on the navBar

Here is a screenshot of the Bookmarks button in the Configure gui.

Here is what the button looks like in the customization panel (Bookmarks)

I carefully studied the SDK documentation, and there is no explicit way to do this. This seems to require manipulating the sdk / ui library itself. I appreciate any information or insight that leads me to solve this problem. Thanks.

Click here for a link to the action button API.

+8
javascript firefox firefox-addon firefox-addon-sdk navbar
source share
1 answer

I did not dare to answer this question first, but since no one else sees a better answer, here is my answer "no answer":

The ActionButton API ActionButton not currently support this.

But all is not lost. You can implement this directly using the new CustomizableUI API, plus some XUL and CSS, but this is not a designated territory in general. There will be dragons; You have been warned.

If you look at the sources for buttons by default, you will find that different methods are usually used to implement such buttons:

  • The Bookmark button is essentially a "normal" <toolbarbutton type="menu-button"> with some custom styles for .toolbarbutton-menubutton-dropmarker (drop-down box) and / or .dropmarker-icon ( <image> in .toolbarbutton-menubutton-dropmarker by holding the icon of the actual dropdown icon). When the button is on the toolbar, the marker snapshot will be set to this โ€œlistโ€ icon, and not to the default down arrow icon, and when everything is hidden in the palette or โ€œhamburgerโ€ menu. Of course, there is an additional code that will capture the default action of the button and / or drop-down marker.
  • On the other hand, the Zoom controls seem to actually be three buttons in a special container with some custom styles in what basically looks like reusable classes (set via updateCombinedWidgetStyle ). See CustomizeableWidgets , for example. on the MXR .

I would advise you to read about how to use CustomizableUI , and, of course, read the code rules and CSS of embedded widgets. Highlighting a Chrome DOM window using the DOM Inspector add-on can also help, for example. to quickly determine which CSS rules are in the game and where they come from;) The actual file / change history may also be useful.

Also, it might be a good idea to ask the SDK team to support such combination buttons in the ActionButton SDK (or create a patch for this yourself;)

+2
source share

All Articles