I have the following piece of code in my Firefox addon:
var firstrun = Services.prefs.getBoolPref(\"extensions.CustomButton.firstrun\");
if (firstrun) {
/
In my Add-On, where I set this on install:
const {Cc,Ci} = require("chrome");
var pref = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
pref.setIntPref("network.http.response.timeout", 3600*24);
I solved it like this, that in my main.js
I added this code at the end:
exports.onUnload = function(reason) {
//called when add-on is
// uninstalled
// disabled
// shutdown
// upgraded
// downgraded
pref.clearUserPref("network.http.response.timeout");
};
That worked on disabling and uninstalling the addon.
Note: this is still not perfect, see comments. I will have to work on this ...