无法执行 jquery 个脚本
Cannot execute jquery scripts
在我的 Chrome 扩展中,我已将 jquery.min.js 包含在清单文件中,如下所示 http://codepaste.net/ve31sq
但我似乎无法在 background.js
中执行此代码部分
function getNparse() {
jAlert('This is a custom alert box', 'Alert Dialog');
}
后台页面永远不会注入任何内容脚本。这不是一个 http://
页面开始,但即使这样也无法为其指定匹配模式。
如果您需要 jQuery 那里(以及插件),您需要将其列为后台脚本:
"background": {
"scripts": ["jquery.min.js", "jAlert-v2.js", "background.js"]
},
请注意:背景页面是不可见的。无论如何,在其上显示自定义警报对您没有帮助。看起来您对扩展程序的工作方式感到困惑;从 Overview page.
开始
此外,你应该学会debug the background page。
在我的 Chrome 扩展中,我已将 jquery.min.js 包含在清单文件中,如下所示 http://codepaste.net/ve31sq
但我似乎无法在 background.js
中执行此代码部分function getNparse() {
jAlert('This is a custom alert box', 'Alert Dialog');
}
后台页面永远不会注入任何内容脚本。这不是一个 http://
页面开始,但即使这样也无法为其指定匹配模式。
如果您需要 jQuery 那里(以及插件),您需要将其列为后台脚本:
"background": {
"scripts": ["jquery.min.js", "jAlert-v2.js", "background.js"]
},
请注意:背景页面是不可见的。无论如何,在其上显示自定义警报对您没有帮助。看起来您对扩展程序的工作方式感到困惑;从 Overview page.
开始此外,你应该学会debug the background page。