For some time now Firefox for mobile has had this nice feature where add-ons could embed their preferences right into the list of add-ons, no need to open a whole a new window like add-ons for desktop have to. During the development of Firefox 4 we were a little jealous of what the mobile team had done and so we drew up some ideas for how the same functionality would look on desktop. We didn’t get time to implement them then but I’m excited that someone from the community stepped up and implemented it for us. Not just that but he made the code shared between mobile and desktop, added some new option types and made it work fine for restartless add-ons which are unable to register their own chrome.
The basic idea is simple. Create a XUL file containing a list of <setting>
elements. Different types of settings are possible, checkboxes, input boxes, menulists, buttons, etc. Each one shows up as a row in the details view for an add-on in the add-ons manager. The XUL file can either be just added to your XPI (call it options.xul
) or referenced by the optionsURL
option in your install.rdf
.
Get it right and you’ll see something like this:
I want to thank Geoff Lankow (darktrojan on IRC) for his awesome work getting this done. This feature is now in the Aurora builds and it’d be great to get add-on developers playing with it. Geoff even wrote up some detailed docs to help you out.
As a bonus Geoff also implemented support for in-tab preferences. This makes Firefox load an add-ons options UI in a new tab instead of a new window. Setting the optionsType
property to 3 enables this.
Nice work Geoff! 😀
Awesome! I really like this idea as it is always hard to figure out where the options are. The mobile firefox does an awesome job of showing these values along with the addon in the “add-on” tab. It makes more sense for the desktop version to have to. 🙂 🙂
Could you please release it with FF 6?? It would be amazing!
Nice feature 🙂
Can we use other XUL, like tabs to organize preferences into sections etc. etc.?
Not at the moment, it’s designed to be simplified preferences. Buttons can be used to open more detailed sections if necessary.
There’s more info here
http://www.darktrojan.net/news/2011-06/new-in-addon-manager-extension-settings-in-mozilla-7
and some useful code for in-tab settings here
http://www.darktrojan.net/news/2011-06/extension-settings-in-a-tab-in-mozilla-7
for those interested.
Is it possible to know from the list view which addons have inline preferences? If it is, then how? If it isn’t, any idea when?
No there isn’t, I’m not sure why you’d want to though. Do you expect users to not try to configure an add-on if it doesn’t have inline preferences?
No. What I mean is that if an addon’s preferences are not inline, it’s useless to click “More…” to get at them, what I need to click in that case is “Preferences”, which will give me out-of-line preferences.
In both cases you can click “Preferences” and it should do the right thing.
Is there a way to open a specified inline option from AoM arguments?
Not right now no.
Never mind. I’ve found it. It’s “BrowserOpenAddonsMgr(‘addons://detail/’ + addonId)”