79588748

Date: 2025-04-23 13:48:49
Score: 0.5
Natty:
Report link

Why do you have to use messaging?

Let's say that config.js is the file containing:

const config = {
     example: "example"
}

I think that you can write the manifest file such as:

{
    "manifest_version": 3,
    "background": {
         "service_worker": "background.js"
    },
    "web_accessible_resources": {
        {
            "resources: ["config.js"],
            "matches": ["<all_urls>"]
        }
    },
    "content_scripts": [
        {
            "matches": ["<all_urls>"],
            "js": ["config.js", "content.js"]
        }
    ]
}

Then you should be able to access it the content.js simply as:

config.example
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): Why do you have to use me
  • Low reputation (0.5):
Posted by: AidH