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