简体   繁体   中英

Chrome extension Content Script not working

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.com/*"
            ],
            "js": [
                "contentscript.js"
            ],
            "run_at": "document_end"
        }
    ],
    "permissions": [
    "tabs", "*://reddit.com/*", "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?

"*://reddit.com/*"与有效的网址不匹配,您应该使用"*://*.reddit.com/*"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM