Firefox Addon: how to remove preferences when addon is being uninstalled?

后端 未结 3 1697
有刺的猬
有刺的猬 2021-01-13 10:44

I have the following piece of code in my Firefox addon:

var firstrun = Services.prefs.getBoolPref(\"extensions.CustomButton.firstrun\");

if (firstrun) {
  /         


        
3条回答
  •  抹茶落季
    2021-01-13 10:57

    AddonManager.addAddonListener({
        onUninstalling: function(addon){
            // alert("uninstalling!");   
            Services.prefs.setBoolPref("extensions.CustomButton.firstrun", true);
        }
      });
    

提交回复
热议问题