Open bugficks opened 1 month ago
we support non-standard cross-browser manifest fields (not released), made by a great contribution here: https://github.com/extension-js/extension.js/pull/128. It allows you to add a browser prefix to manifest fields, like:
{
background: {
firefox:scripts: [...], // applied only to Firefox
service_worker: 'sw.js' // applied only to Chrome
}
this way you can work on multiple browsers at once and ensure compatibility
not sure what I am doing wrong but if I add to source manifest:
"background": {
"chromium:service_worker": "background.ts",
"firefox:scripts": [
"background.ts"
]
},
after running build this ends up in dist/chrome/manifest.json
"background": {
"chromium:service_worker": "background.ts",
"firefox:scripts": [
"background.ts"
]
},
which is even worse :)
my workaround is:
"background": {
"service_worker": "background.ts",
"background": {
"scripts": [
"background/service_worker.js"
]
}
},
which produces the manifest I want :)
@bugficks yeah it's not released yet, there are a few issues with current implementation. Will land in the next release once #137 is out
given:
results in (notice the unprocessed
background.ts
):recent browser versions are able to deal with this. I guess another question is to use the same .ts or allow a different one, in case of possible differences.
Browser support
Support for the scripts, page, and service_worker properties varies between browsers like this: