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

Relationship with service worker needs clarification. #49

Open
steely-glint opened this issue May 23, 2024 · 3 comments
Open

Relationship with service worker needs clarification. #49

steely-glint opened this issue May 23, 2024 · 3 comments

Comments

@steely-glint
Copy link

Our experience of building similar things in the IoT space with webRTC (cameras, baby monitors etc.) Shows that there is a lot of value in being able to use P2P communications within a service worker.
The upper layers do a 'normal' fetch() - but the service worker sends it to a local peer instead of a cloud service - this means the UI code can remain the same for both local/offline and remote/online cases.

@backkem
Copy link
Collaborator

backkem commented May 23, 2024

Good point. The current specification defines the API to be available in both the Window and Worker context:

[Exposed=(Window,Worker), SecureContext]

I'm not sure if we need to add anything specific to also expose it in the service worker context. I'd have to do some research on that.

@wangw-1991
Copy link
Collaborator

Exposed=Worker means this API is available in all worker contexts, including dedicated worker, shared worker and service worker, see blow link for details: https://chromium.googlesource.com/chromium/src/+/master/third_party/blink/renderer/bindings/IDLExtendedAttributes.md#exposed

@backkem
Copy link
Collaborator

backkem commented May 27, 2024

Thanks for digging that up @wangw-1991. For me this satisfies the requirement. Let me know if you agree @steely-glint.

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