在检测Chrome扩展安装或不使用JavaScript时出现错误

问题描述:

这是我的代码,

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

来源: http ://developer.chrome.com/extensions/management.html#method-get
i已经尝试过这种方法。但我收到以下错误:Uncaught TypeError:无法读取未定义的属性'get'

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

如果未定义,重新丢失清单中的管理声明:

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

"permissions": [
          "management"
        ],

来源