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

feat: add support for firefox #427

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

enellis
Copy link

@enellis enellis commented Nov 20, 2024

  • Migrate from CRXJS to Vite Plugin Web Extension.
  • Use webextension-polyfill instead of Chrome API.

In Manifest v3, Firefox still uses background.scripts instead of background.service_worker. To ensure compatibility with both browsers, we include both entries in the manifest file. The unsupported entry will be ignored, but may trigger a warning in developer mode.

@enellis enellis marked this pull request as draft November 20, 2024 13:03
@thieleju
Copy link
Owner

thieleju commented Nov 21, 2024

Wow firefox support would be amazing, thank you ❤️. Also really like the change to move away from the CRXJS plugin.

Unfortunately I don't have much time at the moment, I'll review and test in a few weeks.

#429

@enellis
Copy link
Author

enellis commented Nov 21, 2024

No worries, take your time :) Let me know if you'd prefer the PR to be split into more detailed commits. Also, I'm not entirely confident about the test fixes—maybe you have a better idea on how to prevent the polyfill being loaded when running the tests.

See you in chat! 🎱📖

Replaced all calls to the Chrome API with calls to the
webextension-polyfill.

In Manifest v3, Firefox still uses background.scripts instead of
background.service_worker. To ensure compatibility with both browsers,
we include both entries in the manifest file. The unsupported entry will
be ignored, but may trigger a warning in developer mode.
`webextension-polyfill` can only be loaded in browser contexts.
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

Successfully merging this pull request may close these issues.

2 participants