I created a firefox add-on with the following lib/main.js:
const {Cc,Ci} = require(\"chrome\");
var pref = Cc[\"@mozilla.org/preferences-service;1\"].getServ
I solved the second part (uninstall) 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 add-on.