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

Any chance this libary will be updated to support Service Workers #308

Closed
june07 opened this issue Jan 17, 2023 · 2 comments
Closed

Any chance this libary will be updated to support Service Workers #308

june07 opened this issue Jan 17, 2023 · 2 comments

Comments

@june07
Copy link

june07 commented Jan 17, 2023

Using this in a chrome extension development:

https://chrome.google.com/webstore/detail/nodejs-v8-inspector-manag/gnhhdgbaldcilmgcpfddgdbkhjohddkj?hl=en
https://microsoftedge.microsoft.com/addons/detail/nodejs-v8-inspector-ma/injfmegnapmoakbmnmnecjabigpdjeme

and moving to MV3 which uses ServiceWorkers and not background scripts... I'm running into issues with this library. I was able to get around a "window undefined" issue by setting listenToBrowserNetworkEvents to false, however another problem now is that the library uses superagent which in turn uses XHR. And unfortunately, XHR is not supported by MV3

Workers no longer provide XMLHttpRequest, but instead support the more modern fetch() https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/

So again, any feedback on this would be greatly appreciated.

@montrosb
Copy link

montrosb commented Aug 3, 2023

Our ad blocking extension also uses the PubNub library, and it would be extremely helpful if the JavaScript SDK supported Service Workers.

@june07 june07 closed this as completed Nov 28, 2024
@parfeon
Copy link
Contributor

parfeon commented Nov 28, 2024

The web version of the SDK uses the native Web Fetch API now and for special cases has a separate shared worker script for subscription to deal with browsers' limitations on active connections.

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

No branches or pull requests

3 participants