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
Add a ment  | 

1 Answer 1

Reset to default 12

"*://reddit./*" doesn't match a valid url, you should use "*://*.reddit./*"

本文标签: javascriptChrome extension Content Script not workingStack Overflow