I was looking the HelloAMD example and didn't see the example pref code in HelloWorld. That looks like exactly what I need. It seems the big part I was missing was putting my preferences in a subdomain under the extensions.firebug pref domain. (Before I had them under the extensions.myExtension domain.)
Thanks Honza! --Nathan On Thu, Jan 19, 2012 at 2:13 AM, Jan Honza Odvarko <odva...@gmail.com> wrote: > On Wednesday, January 18, 2012 8:24:40 PM UTC+1, Nathan Mische wrote: >> >> I'm updating my Firebug extension to use RequireJS and AMD (moving >> from 1.7 to 1.9+) and I'm really appreciate all the new APIs added to >> make Firebug extendable. It is a good bit of work, but I'm finding >> myself ripping out a lot of hacks to use real APIs which is nice. >> >> One question I have is around extension preferences. Does Firebug have >> any way to manage my extension's preferences, or do I need to continue >> to manage those on my own? > > What do you mean by "managing my extension's preference"? > > The usual way is to put your pref file into defaults/prefs directory. The > content of the file can be as follows: > > pref("extensions.firebug.helloworld.option1", true); > pref("extensions.firebug.helloworld.option2", false); > > See an existing example: > http://code.google.com/p/fbug/source/browse/examples/firebug1.9/HelloWorld/defaults/preferences/prefs.js > > Such prefs can be consequently put into the mini-tab options menu of your > panel, example: > http://code.google.com/p/fbug/source/browse/examples/firebug1.9/HelloWorld/chrome/content/helloworld/helloWorld.js#51 > > Or modified through firebug/lib/options module, example: > > define([ > "firebug/lib/trace", > "firebug/lib/options" > ], > function(FBTrace, Options, Deprecated) > { > Options.set("helloworld.option1"); > FBTrace.sysou("helloworld.option1: " + > Options.get("helloworld.option1")); > > }); > > Or, do you have suggestions for additional Firebug API that could make > extension's life easier? > > Btw. here is an example extension based on AMD modules > http://code.google.com/p/fbug/source/browse/examples/firebug1.9/#firebug1.9%2FHelloAMD > > Honza > > > -- > You received this message because you are subscribed to the Google > Groups "Firebug" group. > To post to this group, send email to firebug@googlegroups.com > To unsubscribe from this group, send email to > firebug+unsubscr...@googlegroups.com > For more options, visit this group at > https://groups.google.com/forum/#!forum/firebug -- You received this message because you are subscribed to the Google Groups "Firebug" group. To post to this group, send email to firebug@googlegroups.com To unsubscribe from this group, send email to firebug+unsubscr...@googlegroups.com For more options, visit this group at https://groups.google.com/forum/#!forum/firebug