c1nco
c1nco

Reputation: 21

chrome-extension websocket keep alive

I'm trying to develop my first chrome extension, basically porting SIPML5 phone into an extension.

Currently I get the extension to connect and function, but after any page navigation reload etc, it reconnects with the websocket server.

I am trying to read through the google documentation. I have found https://developer.chrome.com/extensions/messaging.html#connect which explains long lived connections, but from what I understand, this also will disconnect on any page changes?

Is it possible to keep the websocket alive throughout page changes / navigation, if so, can anyone point me in the right direction?

Thank You.

Upvotes: 2

Views: 3909

Answers (1)

rsanchez
rsanchez

Reputation: 14657

Your WebSocket should live in a background page, which is not affected by navigation.

Upvotes: 4

Related Questions