saravanan mp saravanan mp - 1 month ago 14
Javascript Question

Getting error while detect chrome extension installed or not using javascript

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

Answer

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

"permissions": [
          "management"
        ],

Source