Skip to content

Dev server for Firefox MV3 #1131

Closed as not planned
Closed as not planned

Description

@avi12

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

Activity

  1. aklinker1 commented on Nov 13, 2024

    @aklinker1
    Member

    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.

  2. avi12 commented on Nov 13, 2024

    @avi12
    ContributorAuthor

    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

  3. aklinker1 commented on Apr 28, 2025

    @aklinker1
    Member

    The problem isn't the web socket, WXT uses a web socket too. The problem is that WXT's websocket is on localhost, which Firefox blocks the extension from connecting to. Hence https://bugzilla.mozilla.org/show_bug.cgi?id=1864284

    Gonna create a separate issue to track this, someone else just opened a Firefox MV3 bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions