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

Native messaging connection from service worker #256

Open
larry-xu opened this issue Aug 18, 2022 · 3 comments
Open

Native messaging connection from service worker #256

larry-xu opened this issue Aug 18, 2022 · 3 comments
Labels
topic: service worker Related to service worker background scripts

Comments

@larry-xu
Copy link

Chrome recently added support for service workers to run beyond the default 5 minute timeout if there is an open native messaging connection. See https://bugs.chromium.org/p/chromium/issues/detail?id=1189678

This is useful for extensions to receive messages from a connected native messaging host at any time. Otherwise, if the service worker terminates, then the connection is lost, and the native messaging host cannot send messages to the extension.

Can we standardize this functionality in MV3, so that it can be adopted by Firefox and Safari? And would this behavior differ at all between service workers and event pages?

@bershanskiy
Copy link
Member

Please note that this is not really applicable to Firefox yet, since Firefox does not support service worker backgrounds yet. I'm not sure how Safari handles this case.

@xeenon
Copy link
Collaborator

xeenon commented Aug 18, 2022

Safari does not have a fixed timeout for service workers or background pages. As long as there is activity (events, messages, etc) the service worker will stay alive.

@zombie
Copy link
Collaborator

zombie commented Aug 18, 2022

Firefox has the same approach to Safari, as long as extension has any activity, the native messaging connection would stay alive.

@xeenon xeenon added the topic: service worker Related to service worker background scripts label Aug 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: service worker Related to service worker background scripts
Projects
None yet
Development

No branches or pull requests

4 participants