javascriptgoogle-chrome-extension

Chrome extension content script not loading


I am trying to add a content script to my chrome extension but for some reason the content script is not getting executed

Content script code:

console.log("In content script");

File name is content.js

My manifest file:

{
    "name": "Getting Started Example",
    "description": "Build an Extension!",
    "version": "1.0",
    "manifest_version": 3,
    "background": {
        "service_worker": "background.js"
    },
    "permissions": [
        "storage",
        "activeTab",
        "scripting",
        "tabs"
    ],
    "action": {
        "default_popup": "popup.html"
    },
    "content_scripts": [
        {
            "all_frames": true,
            "matches": [
                "<all_urls>"
            ],
            "js": [
                "content.js"
            ]
        }
    ],
    "options_page": "options.html"
}

Solution

  • I am really sorry content script's answers appear in the browser console and not the extension's console and I was only checking the extensions console until now

    Everything is working as it should.