According to the Firefox Add-on SDK documentation here: Listening for Load and Unload
When trying to run the following function that acts as a listener for when a user disables or uninstalls an add-on if the reason parameter is the string "uninstall" it is never called. Example follows:
exports.onUnload = function (reason) {
if(reason === 'uninstall') {
tabs.open("http://www.google.com");
}
};
As mentioned previously this code will never run as when reason is the string uninstall it is bugged and does not work. I was wondering if anyone knew a work around to that specific bug so that I can redirect a user to a specific url when they uninstall the add-on.
This is because unload is always done first. This is on purpose to prevent an addon developer with malicious intent from doing bad things if the user chooses to uninstall their addon. As far as I know there is no way to work around this strictly within an addon.