Firefox extension that changes the value in about: config

I searched around the Internet for a little light, but found nothing. I need to create a Firefox extension that, among several other things, changes the value of one of about: config variables. None of the tutorials I found address this issue, so I donโ€™t know where to start. Can someone give me a link or some lines of code or explanation to help me get started? Thanks in advance.

+4
source share
2 answers

About: config values โ€‹โ€‹are available through the settings system. The reason you prefix an extension prefix with extensions.myextension is because you need to make sure that you donโ€™t encounter Firefox or other extension settings.

To get a preference for firefox, just use the same preference name, which you see roughly: config. If you notice, you will see that you also see all extension prefixes approximately: config too.

https://developer.mozilla.org/en/XUL_School/Handling_Preferences * https://developer.mozilla.org/en/Code_snippets/Preferences

+3
source

If you use bootstrap, this should do what you are looking for:

prefs = require("sdk/preferences/service"); prefs.set("extensions." + extensionName + ".sdk.console.logLevel", "all"); 

This may not be the most elegant solution, but you can comment on the code before posting.

If anyone finds a better way, please let me know!

0
source

All Articles