Is there a hook to run an add-on on the uninstall event?

I’m writing an add-on that aims to add syntax highlighting. In this tool I’m adding a custom style and javascript to all card types, so that it works in AnkiDroid as well.

To be a well-behaving plugin, I would like the plugin to clean up the custom setup upon uninstalling but I can’t find a good way to do this.

I think it would be better to give the user a ‘reset card style’ option. People might want to install the add-on to set up their cards, but have no reason to leave it installed once the cards are set up.

2 Likes