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

Dev server for Firefox MV3 #1131

Open
avi12 opened this issue Nov 1, 2024 · 2 comments
Open

Dev server for Firefox MV3 #1131

avi12 opened this issue Nov 1, 2024 · 2 comments
Labels

Comments

@avi12
Copy link
Contributor

avi12 commented Nov 1, 2024

Is your feature request related to a bug?

N/A

What are the alternatives?

Currently, there is no alternative

Additional context

I discovered that when I register a Firestore event listener in the background script, not only does it prevent the background script from being terminated, but on all browsers, including Firefox MV3, whenever I make a change in the Firestore database, the attached event listener will fire instantly
It's worth exploring how the Firebase team managed to do this and apply the same technique to make a dev server for Firefox
I believe that this is the function

@avi12 avi12 added the feature label Nov 1, 2024
@aklinker1
Copy link
Collaborator

aklinker1 commented Nov 13, 2024

They use a websocket. Websockets are known to keep the background service worker alive. But there are other ways as well, like what WXT does for development: https://github.com/wxt-dev/wxt/blob/main/packages%2Fwxt%2Fsrc%2Fvirtual%2Futils%2Fkeep-service-worker-alive.ts

Not sure how this would help with the last TODO of #230 though... Is this about adding support to dev mode for Firefox MV3? If so, how would this help us?

The problem is that localhost is blocked by the CSP in Firefox.

@avi12
Copy link
Contributor Author

avi12 commented Nov 13, 2024

I'm not sure of the mechanics that the Firebase SDK uses to connect between the client and the server, but the team worked it out such that as soon as as soon as a ping is sent from the server, the client can respond
If a similar mechanism could be implemented in WXT, it can enable restarting parts of the extension similar to how you made WXT do it in Chrome MV3

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

No branches or pull requests

2 participants