I’m quite new to addon development with firefox. I picked the addon sdk for porting my chrome extension to firefox.
What would you suggest to display a options page / options panel / options window to a user?
Loading a options.html file from my addon directory works quite fine (addTab(data.url(“options.html”));), but i can’t attach page-mods to it, as far as a i know. Therefore i can’t communicate with the main.js to save my options, right?
Also how should the user access it?
In chrome this is quite easy. Rightclick your icon -> options and it opens up for you.
Are there ways to create a simliar behaviour for firefox?
Any suggestions on that?
Starting with the Add-on SDK 1.4 you have the
simple-prefsmodule. It will automatically generate inline options for your add-on – these are displayed directly on your extension’s page in the Add-ons Manager. That should be the preferred way to display options. The downside: opening the options programmatically is non-trivial, even for classic add-ons. And the SDK doesn’t seem to support complicated controls (documentation of what’s possible with inline options), only the most basic ones.If you want to roll your own, you probably want to integrate an “Options” button into a drop-down panel. You should also be able to attach a content script to it via
page-modpackage, something like this should work:Downside here: using the standardized way to display add-on options (via Add-ons Manager) won’t be possible, the SDK doesn’t support anything but inline options.