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

Listen for wake lock release #1120

Closed
DNin01 opened this issue Oct 31, 2023 · 0 comments · Fixed by #1158
Closed

Listen for wake lock release #1120

DNin01 opened this issue Oct 31, 2023 · 0 comments · Fixed by #1158

Comments

@DNin01
Copy link
Collaborator

DNin01 commented Oct 31, 2023

Currently, my Wake Lock extension does not know when a wake lock has been released. A wake lock can be released for reasons as simple as navigating away from the browser tab it was set in. Fortunately, you can add an event listener for when the wake lock is released.

I'll try to make some changes later.

GarboMuffin pushed a commit that referenced this issue Jan 28, 2024
Resolves #1120

Currently, if you request a wake lock with the Wake Lock extension and
then navigate away from the page, the wake lock gets released in the
background because wake locks are automatically released when the
document gets hidden, plus, the extension isn't aware of when this
happens, so you have no way of knowing.

This change makes the extension automatically request another wake lock
when the document regains visibility after having been hidden. It still
reports to the project that the wake lock is enabled when this happens,
therefore projects will act like nothing happened but the wake lock will
still be there as long as you come back. I also considered the
possibility of projects enabling or disabling wake lock when the
document is hidden and now handle it properly.

I tested these changes in Edge to the best of my ability.
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

Successfully merging a pull request may close this issue.

1 participant