I have a chrome extension that makes use of a WebSocket connection that runs indefinitely in a background script. Because MV2 will cease to function in the future, I'm trying to migrate to MV3. I've looked into service workers for the past few days. The problem is that it doesn't seem like they can help me with my need for a long-term connection, because of their short lifespan. Is there a way to maintain my WebSocket connection in this way using a service worker? If not, what alternative (capable of two-way communication) to a WebSocket could I use?
Thanks in advance.