Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if Chrome extension installed in unpacked mode

Is there a way to detect whether I'm running an extension that was installed from my .crx file or the extension was loaded as via 'Load unpacked extension...' button?

I'm aware about ID differences in that case, but I don't want to rely on hardcoded strings in the code.

like image 399
Alexander Gromnitsky Avatar asked Oct 11 '12 00:10

Alexander Gromnitsky


People also ask

How do I know if Chrome extensions are installed?

On your computer, open Chrome . At the top right, click Extensions . point to "This can read and change site data."

What is an unpacked extension?

Chrome extensions can be either packed or unpacked. Packed extensions are a single file with a . crx extension. Unpacked extensions are a directory containing the extension, including a manifest. json file.

Where are Chrome extension settings stored?

Storage Location for Packed Extensions. Navigate to chrome://version/ and look for Profile Path, it is your default directory and Extensions Folder is where all the extensions, apps, themes are stored.


1 Answers

If by "installed from my .crx file" you mean installed from Chrome Web Store you can simply check extension manifest.json for value of update_url attribute. CWS adds it when you upload your extension.

If you have a self-hosted .crx file, get your extension information using chrome.management.getSelf() and check installType of returned ExtensionInfo object. If it says "development" that means that extension was loaded unpacked in developer mode. "normal" means that it was installed from .crx file.

like image 91
Konrad Dzwinel Avatar answered Sep 20 '22 23:09

Konrad Dzwinel