Remove Chrome extension via code

An extension can remove itself by calling chrome.management.uninstallSelf();.

If your extension wants to remove another extension, declare the management permission in the manifest file and call chrome.management.uninstall('<id of other extension>');.

You cannot uninstall an extension from the command line any more as of Chrome 36.0.1960.0 (using --uninstall-extension, crbug 351294).


If anyone is looking for an alternative to --uninstall-extension, here is a try: sadly this doesn't work from command line, but you can be used to programmatically do stuff with extensions.

manifest.json

{
  "manifest_version": 2,
  "name": "Uninstaller",
  "version": "1.0",
  "description": "Uninstalls hardcoded extensions.",
  "permissions": [ "management" ],
  "browser_action": { },
  "background": { "scripts": ["background.js"] }
}

background.js

chrome.browserAction.onClicked.addListener(function(tab) {
  chrome.management.uninstall('ckibcdccnfeookdmbahgiakhnjcddpki');
  chrome.management.uninstallSelf();
});

Usage

  1. Save the above two files to a new folder
  2. Change the ID of the extension you want to uninstall in background.js
  3. Open chrome://extensions (or Menu > Settings > Extensions)
  4. Tick Developer mode
  5. Click Load unpacked extension
  6. Browse the folder you saved the files to
  7. Click the new icon that appears next to the hamburger menu
    in the top right corner (puzzle piece)
  8. Untick Developer mode
  9. Delete the folder with the two files