I am able to know when the user is uninstalling or disabling the add-on by using the following code.
exports.onUnload = function (reason) {
if(reason==="disable"||reason==="uninstall"){
//stuff here
}};
I need to stop disabling/uninstallation of the add-on. My add-on is a security related add-on. When the user is trying to uninstall the add-on, I need to confirm with the user using master password authentication. If he enters the master password, then uninstall the add-on. If he fails to enter the master password, then add-on should continue working.