0
我正在做一个简单的扩展,我试图在这些特定的网页中包含一个内容脚本。但问题是他们没有被纳入网站。我使用Chrome的开发人员工具工具进行了检查。 然后我将match_urls设置为所有页面,但仍不包含它们。Chrome扩展的内容脚本没有被注入任何网页
这里的manifest.json的:
{
"manifest_version": 2,
"name": "TestExten",
"description": "Test description.",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"run_at": "document.end",
"js": ["content.js"]
}
],
"permissions": [
"tabs",
"http://*/", "https://*/",
"cookies"
],
}
和content.js:
alert("loaded");
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
alert("received message");
});
什么错吗?
您确定扩展程序正在安装并启用吗? – Barmar
它是'document_end'(而不是'document.end') – Deliaz