Chrome 扩展内容脚本不工作
Chrome extension Content Script not working
我构建了一个 Chrome 扩展脚本,应该 运行 在 Reddit 上。
我的脚本:
console.log("hello world");
我的manifest.json
{
"manifest_version": 2,
"name": "Name",
"description": "Desc",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": [
"*://reddit.com/*"
],
"js": [
"contentscript.js"
],
"run_at": "document_end"
}
],
"permissions": [
"tabs", "*://reddit.com/*", "activeTab"
]
}
脚本没有出现在 chrome 开发工具的 "Content Script" 部分。有谁知道为什么我的分机不是 运行ning?
"*://reddit.com/*"
与有效的 url 不匹配,您应该使用 "*://*.reddit.com/*"
我构建了一个 Chrome 扩展脚本,应该 运行 在 Reddit 上。
我的脚本:
console.log("hello world");
我的manifest.json
{
"manifest_version": 2,
"name": "Name",
"description": "Desc",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": [
"*://reddit.com/*"
],
"js": [
"contentscript.js"
],
"run_at": "document_end"
}
],
"permissions": [
"tabs", "*://reddit.com/*", "activeTab"
]
}
脚本没有出现在 chrome 开发工具的 "Content Script" 部分。有谁知道为什么我的分机不是 运行ning?
"*://reddit.com/*"
与有效的 url 不匹配,您应该使用 "*://*.reddit.com/*"