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

Unify manifest.json #270

Open
rougetimelord opened this issue Apr 19, 2024 · 2 comments
Open

Unify manifest.json #270

rougetimelord opened this issue Apr 19, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@rougetimelord
Copy link
Collaborator

rougetimelord commented Apr 19, 2024

It would be nice to have a single manifest.json file for Firefox and Chrome. We could do this by migrating Firefox to MV3.

The main issue is how we load our service worker or background script (for Firefox). According to MDN:

  • Since Chrome 121, Chrome will ignore the background.scripts field for MV3 extensions. Chrome <121 it will refuse to load the extension entirely.
  • Firefox 121+, ignores background.service_worker and will run the background.scripts normally. Firefox <121 will not run background.scripts if background.service_worker is present.
  • Safari supports background.service_worker and/or background.scripts, and gives priority to background.service_worker.

We would also still need to add browser_specific_settings for Firefox. Due to that we could keep the background.service_worker key replacement in our build process, to make sure that Firefox <121 is supported.

In terms of code changes according to Mozilla's extension tester, the only change needed would be to remove chrome.runtime.restartAfterDelay from src/constants.ts. I think that's fine since we don't ever use it, and it should probably be removed anyways.

@rougetimelord rougetimelord self-assigned this Apr 19, 2024
@rougetimelord rougetimelord added the enhancement New feature or request label Apr 19, 2024
@kheina
Copy link
Collaborator

kheina commented Apr 20, 2024

#39 (comment)

@rougetimelord
Copy link
Collaborator Author

Oh Mozilla/Google, very nice of you to make everything complicated and hard to support cross browsers!

Seems like Firefox 102ESR is past EOL (9/26/2023), and Firefox 115.2.0ESR released in August 2023 which afaik means that (most) ESR installations should support Mv3.

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

No branches or pull requests

2 participants