Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-standard cross-browser manifest fields #122

Closed
cezaraugusto opened this issue Jun 28, 2024 · 2 comments
Closed

Support non-standard cross-browser manifest fields #122

cezaraugusto opened this issue Jun 28, 2024 · 2 comments
Assignees

Comments

@cezaraugusto
Copy link
Member

cezaraugusto commented Jun 28, 2024

There are cases when a feature is desired in a browser but not in the other browser, say using background.service_worker for Chrome and background.scripts for Firefox.

The easier route is having multiple manifest.json files specific for browsers (like manifest.edge.json). I'd like to avoid this for now.

The solution that comes to mind is having some sort of prefix to manifest fields, which would be handled by the CompatPlugin. Like:

{
  // Applies to Chrome only
  "chrome:side_panel": "...",
  "background": {
    // Applies to all Chromium-based browsers
    "chromium:service_worker": "sw.js",
    // Applies to Firefox
    "firefox:scripts": ["bg.js"]
  }
}

Chrome would understand the manifest.json as:

{
  // Applies to Chrome only
  "side_panel": "...",
  "background": {
    // Applies to all Chromium-based browsers
    "service_worker": "sw.js"
  }
}

Firefox:

{
  "background": {
    // Applies to Firefox
    "scripts": ["bg.js"]
  }
}
@cezaraugusto
Copy link
Member Author

Lack of this feature prevent us from having templates using service workers from being compatible with Firefox in production mode.

@cezaraugusto
Copy link
Member Author

closed by #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant