How to prompt user to uninstall Add-on

According to the Prompt users for data and privacy consents docs, if the user doesn’t accept the mandatory privacy policy, the user should be prompted to uninstall the add-on. How can this be accomplished? The only reference I found was this stackoverflow question from 2014 referencing a AddonManager, but this seems deprecated, since no documentation exists.

How can an addon prompt the user to uninstall itself?

Hey @Morpheus0x!

You can use management.uninstallSelf to prompt the user for uninstallation.

It will show this kind of prompt when ran with showConfirmDialog option:

Thanks for your very quick reply. This works very nicely! Odd that I didn’t find any reference to this after heavy googling.

I’ll take a look at the documentation to add a link from the Extension Workshop page to the right MDN page to make it clearer. Thanks for bringing this question up!

1 Like