byte
byte

Reputation: 133

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?

Upvotes: 3

Views: 8260

Answers (1)

Haibara Ai
Haibara Ai

Reputation: 10897

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

Upvotes: 12

Related Questions