3

Here is My code,

var myExtension = chrome.management.get( "my_extention_id" );
if (myExtension.enabled)
{
// installed
}
else { ... }

source : http://developer.chrome.com/extensions/management.html#method-get i have tried this method. But i'm getting following error: Uncaught TypeError: Cannot read property 'get' of undefined

saravanan mp
  • 745
  • 3
  • 16
  • 34
  • What exactly are you trying to do? It's unclear. Are you detecting from another extension, from a regular webpage? Is this an extension you control? – Xan Nov 27 '14 at 08:55
  • Possible duplicate of [Check whether user has a Chrome extension installed](http://stackoverflow.com/questions/6293498/check-whether-user-has-a-chrome-extension-installed) – Simon East Oct 24 '16 at 04:51

2 Answers2

6

Check in another extension:

https://gist.github.com/greatghoul/321b4f32c0b7a6ad8a97

Check in webpage

https://developer.chrome.com/extensions/messaging#external-webpage

In manifest file, remember to register webpage you want to check extension from.

"externally_connectable": {
    "matches": ["*://developer.chrome.com/*"]
}

then you can use chrome.runtime.sendMessage in that page.

greatghoul
  • 1,448
  • 1
  • 17
  • 19
2

If it's undefined then you're missing the management declaration in the manifest:

"permissions": [
          "management"
        ],

Source

Omri Aharon
  • 16,959
  • 5
  • 40
  • 58
  • Dear @Omri Aharon , chrome.management.get... , returns this error: `Uncaught TypeError: Cannot read property 'get' of undefined` , In calling from external page. Also as we use nativeMessaging and MessagePassing we insert in the permissions these values: `NativeMessaging`, `tabs` and `some patern like http://*/*` and `management`. – Hosein Aqajani Dec 19 '15 at 12:23