在检测Chrome扩展安装或不使用JavaScript时出现错误 [英] Getting error while detect chrome extension installed or not using javascript

查看:145
本文介绍了在检测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"
        ],

来源

这篇关于在检测Chrome扩展安装或不使用JavaScript时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆