Skip to content

Allow the Service Worker to activate the app #700

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

Open
Jaifroid opened this issue Mar 16, 2025 · 0 comments
Open

Allow the Service Worker to activate the app #700

Jaifroid opened this issue Mar 16, 2025 · 0 comments
Assignees
Labels
backend upstream Should be worked on in kiwix-js
Milestone

Comments

@Jaifroid
Copy link
Member

As a pre-requisite to #699, it would be necessary to allow the Service Worker alone to activate the main app. Here's how this should work:

  • The Service Worker has previously registered a Fetch event listener
  • When a Fetch event occurs (or potentially some others if we were to have push notifications, for example), the Service Worker can:
    • Check if the app is already open using clients.matchAll()
    • If open, focus that window using client.focus() (we may not need this)
    • If closed, launch the app with clients.openWindow(url)
@Jaifroid Jaifroid added this to the Release 3.6.0 milestone Mar 16, 2025
@Jaifroid Jaifroid self-assigned this Mar 16, 2025
@Jaifroid Jaifroid added the upstream Should be worked on in kiwix-js label Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend upstream Should be worked on in kiwix-js
Projects
None yet
Development

No branches or pull requests

1 participant