I port a Chrome extension to Firefox. Because the XUL-based API is quite different from Chrome API, so I use the new add-on SDK of firefox.
There is a interface called “widget” can be used to make a little icon button like “BrowserAction” of Chrome, but “widget” is on the bottom of window, “BrowserAction” is on the top right side of window.
Some firefox extensions, for example, GreaseMonkey , have widgets on the top right, so I’m asking how to implement it using add-on SDK, not XUL based API?
Erik Vold has created a library that allows you to do this:
https://github.com/erikvold/toolbarbutton-jplib/blob/master/lib/toolbarbutton.js
While this code isn’t included in the SDK libraries, it can be used to get the result you want with the current version of the SDK. You can see a quick example using Erik’s library here:
https://builder.addons.mozilla.org/addon/1031142/latest/