twilio / twilio-client.js

Twilio’s Programmable Voice JavaScript SDK
https://www.twilio.com/docs/voice/client/javascript
Other
67 stars 32 forks source link

[FEATURE] Chrome Extension Manifest V3 Support #331

Open charliesantos opened 6 months ago

charliesantos commented 6 months ago

In manifest V2, extensions have the ability to run the Twilio Voice JS SDK in the background. But with the introduction of manifest V3 (MV3), running the Twilio Voice JS SDK in the background using service workers does not work out of the box due to certain limitations which include DOM access and the ability to keep the service worker alive.

In order to make outgoing calls and listen/receive incoming calls through the SDK, the service worker should be connected to a WebSocket server and should send/receive messages periodically to keep it alive. Also, the service worker should create offscreen documents to run the SDK. Check our example in our version 2.x repository to see how this works.