What is the format for declaring that an addon's preferences should sync across firefox installations? I see a short description that you should create services.sync.prefs.sync.extension.frobnaz.foobar
but how should that be entered in the package.json that defines the addon's preferences? For instance, say I've defined a preference there:
"preferences": [{"name": "show_xyz",
"type": "bool",
"title": "Show XYZ",
"value": true}]
In firefox's about:config
this is ultimately translated into the preference extensions.<addon id>@jetpack.show_xyz
. So how should services.sync.prefs.sync.*
preferences be created?
You have to deal with this programmatically, through the preferences/service
module.
var ps = require('sdk/preferences/service');
var addonid = require('sdk/self').id;
var simpleprefs = ps.keys('extensions.' + addonid);
simpleprefs.forEach(function(prefname){
ps.set('services.sync.prefs.sync.extensions.' + addonid + '.' + prefname, true)
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With