admin管理员组文章数量:1279015
I built a Chrome Extension script that is supposed to run on Reddit.
My script:
console.log("hello world");
My manifest.json
{
"manifest_version": 2,
"name": "Name",
"description": "Desc",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": [
"*://reddit/*"
],
"js": [
"contentscript.js"
],
"run_at": "document_end"
}
],
"permissions": [
"tabs", "*://reddit/*", "activeTab"
]
}
The script doesn't show up in the "Content Script" section in the chrome dev tools. Does anyone have an idea why my extension is not running?
I built a Chrome Extension script that is supposed to run on Reddit.
My script:
console.log("hello world");
My manifest.json
{
"manifest_version": 2,
"name": "Name",
"description": "Desc",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": [
"*://reddit./*"
],
"js": [
"contentscript.js"
],
"run_at": "document_end"
}
],
"permissions": [
"tabs", "*://reddit./*", "activeTab"
]
}
The script doesn't show up in the "Content Script" section in the chrome dev tools. Does anyone have an idea why my extension is not running?
Share Improve this question edited Aug 17, 2016 at 0:34 byte asked Aug 17, 2016 at 0:14 bytebyte 1331 silver badge7 bronze badges 2- I don't think the extension will work without a "name" defined in the manifest. – Mottie Commented Aug 17, 2016 at 0:31
- I removed it for the purposes of this question. I'll edit one back in. @Mottie – byte Commented Aug 17, 2016 at 0:33
1 Answer
Reset to default 12"*://reddit./*"
doesn't match a valid url, you should use "*://*.reddit./*"
本文标签: javascriptChrome extension Content Script not workingStack Overflow
版权声明:本文标题:javascript - Chrome extension Content Script not working - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741222885a2361304.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论