Skip to content

[improvement request] Prevent screen lock #113

Description

@nenadalm

When somebody thinks for a while, it can happen that screen turns off. It would be nice if screen was still on. There's an api for that: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API

So something like:

navigator.wakeLock?.request("screen").then(() => {
  document.addEventListener("visibilitychange", () => {
    if (document.visibilityState === "visible") {
      navigator.wakeLock.request("screen");
    }
  });
})

should do the trick.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions