Skip to content

SharedService-sw vs SharedService #223

Answered by rhashimoto
uma-uc asked this question in Q&A
Discussion options

You must be logged in to vote

Both of these demos show how a dedicated Worker can be used to handle requests from multiple tabs/windows, instead of a SharedWorker which may not support certain APIs (such as synchronous OPFS). The details are discussed here.

The original implementation and demo does use a SharedWorker to set up communications to the shared Worker. This satisfies the goal of allowing the use of APIs that require a Worker. However, using SharedWorker at all, even in this much smaller role, means that it won't work on Android Chrome which still doesn't support SharedWorker. Fortunately, it turns out that the setup role can also be handled with a service worker, which is supported on all modern browsers (i…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by uma-uc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants