7

I am developing a Firefox extension and want to open a custom html page where the user can adjust the settings. I am able to do it in different ways, but would like to use the standard Options button that is shown in the add-on manager of Firefox.

I have seen some documentation about it, but I am having problems on finding proper documentation for this function using the online Add-on Builder: Preferences system, Inline options, Simple prefs.

Does anybody know how to just add that standard Options button that is shown in the add-on manager and handle its click event to show a custom options page? (just like it's possible in Google Chrome)

cprcrack
  • 17,118
  • 7
  • 88
  • 91

1 Answers1

4

Builder projects have an 'Properties' dialog that has a field you can paste the extra JSON in that you need to create preferences:

https://www.evernote.com/shard/s1/sh/cdb97850-935d-4cf1-95f1-a25c130d1498/4b0b2553f3aa85e4d6489c1d50492c97

( fixed the link, sorry )

Here's an example in builder that implements all the different types, and contains documentation as well:

https://builder.addons.mozilla.org/package/60337/latest/

You'll notice that one of the type of prefs you can define is a 'control' pref, essentially a button that emits a custom event you can listen of and react to from main.js. You could then open a new tab or addon-page with additional preferences?

https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/addon-kit/simple-prefs.html#prefs

therealjeffg
  • 5,790
  • 1
  • 23
  • 24
  • That's great, thanks a lot. With this example I was able to find a workaround: put a single button in the preferences that opens a custom preferences page. However, ideally I would like to use that "Options" button of the add-on manager to directly open my custom preferences page. – cprcrack Oct 25 '12 at 12:00
  • Your evernote links give me "access denied". Are they accessible for registered users only? – Wladimir Palant Oct 25 '12 at 19:09
  • @cprcrack: I don't think that the Add-on SDK currently supports custom preference pages. Sadly, your workaround is the best you can do. – Wladimir Palant Oct 25 '12 at 19:11