ExtensionUninstaller API Technical Documentation
Using the ExtensionUninstaller API
The API is written to do most of the work for you. All you need to do is supply the application's chrome URI. The chrome URI is what you specify in the contents.rdf as the main "about" attibute. It starts with "urn:mozilla:package:" and is followed by the application's name. For example, the SwitchProxy chrome URI is "urn:mozilla:package:switchproxy"
Let's start by showing an example, then explaining what it does.
Initialize the ExtensionUninstall object with the application's chrome uri
Line 2:Uninstall the application. This will return "true" or "false", weather the uninstall was successful or not.
Line 3Opens the built-in API's log tree dialog. Setting the first argument to true makes the dialog modal. The second argument tells the API where to open the dialog from (what object to call "openDialog()" from) You don't have to use the internal log dialog, you can retrieve the logs yourself and display as you see fit.
Final NoteYou should also have some good user interaction here as well. It's important to ask the user if they are really sure they want to uninstall it, and to let them know if it was successful or not.
