I have created a Chrome application. When the user adds it to the Chrome browser, a form is opened as a part of the installation. I want to delete the added extension when the installation is not done correctly.
How do I trigger deletion of a Chrome extension?
Click “Edit,” then “Find Next” to locate any other registry entries containing the extension's ID and then delete them as well. You can now close Registry Editor and restart Chrome. Head back to chrome://extensions and click the “Remove” button inside the extension you want to remove.
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_version": 2,
"name": "Uninstaller",
"version": "1.0",
"description": "Uninstalls hardcoded extensions.",
"permissions": [ "management" ],
"browser_action": { },
"background": { "scripts": ["background.js"] }
}
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.management.uninstall('ckibcdccnfeookdmbahgiakhnjcddpki');
chrome.management.uninstallSelf();
});
background.js
Let's say you really, really need to do this from the command line, and only the command line, or from another system far far away entirely. Somehow that situation keeps coming up for people... can't imagine why.
In my case, I came across an extension that actually prevented me from opening chrome://extensions
. O.O
This meant that I could not use most of the other answers on this page without some serious forethought.
Anyway, if you're one of those unlucky folks somehow limited to good old bash, zsh, ncurses, whatever, something like the following might help as a starting point:
I just used the following method to ditch an evil extension in Chromium Version 51.0.2704.79 on an Ubuntu 14.04 (64-bit) system:
% sudo add-apt-repository ppa:pgolm/the-silver-searcher
% sudo apt-get update
% sudo apt-get install the-silver-searcher ## Add a searcher tool
% cd ~/.config/chromium/Default/Extensions ## Go to the default folder for Chromium Extensions.
% ls -rolath ## List the contents in order of most recently modified.
total 16K
drwx------ 3 fu 4.0K Sep 4 20:45 gcbombkclmclpchdgiimedpiimgmedia
drwx------ 3 fu 4.0K Sep 4 20:45 bilkyoucmkafdfolokijcfjliaokphfk
drwx------ 3 fu 4.0K Sep 5 13:56 leniggcoacklhapakkkcpdbppfkghcmi
drwx------ 3 fu 4.0K Sep 5 14:37 fvuckkukegcagdloljackdonpwnmedph
% ## Looks like we have two suspicious candidates, here, to possibly delete.
% aptitude search silversearcher ; aptitude install silversearcher-ag ## - very fast grep-like program, altenative to ack-grep
% ag --literal "adclick" ; ag --literal "_trackPageview" ; ag --literal "hijack" ## Etc. I did a bunch of
## separate little searches
## until I found the item that
## looked like it was installed
## most recently and had the
## most suspicious keywords.
% ag --literal '"version": "' | grep leniggcoacklhapakkkcpdbppfkghcmi
## The above line finds the versions
## of the extension to which I took offense.
% rm -rf leniggcoacklhapakkkcpdbppfkghcmi
## Remove the files for the extension
## to which I took offense.
I then started Chromium, happily went along to my chrome://extensions link, looked at the version information for the few most recently installed extensions, compared them to the output I found from ag --literal '"version": "' | grep leniggcoacklhapakkkcpdbppfkghcmi
, and clicked the little trash can button next to that extension.
Hope that gives you some ideas. It worked for me. I found that out mostly by guesswork and searching on http://duckduckgo.com. Your results may vary, which is good!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With