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

Add support for the Chrome Wake Lock API to the views pages to allow the phone view to not hiberate/screen saver mode. #145

Open
MintyMods opened this issue Dec 10, 2019 · 1 comment
Labels
Client-Side Front end browser side enhancement New feature or request

Comments

@MintyMods
Copy link
Owner

No description provided.

@MintyMods MintyMods added Client-Side Front end browser side enhancement New feature or request labels Dec 10, 2019
@MintyMods
Copy link
Owner Author

MintyMods commented Dec 10, 2019

let wakeLock = null;

const requestWakeLock = async() => {
 try {
  wakeLock = await navigator.wakeLock.request('screen');
   wakeLock.addEventListener('release',() => {
    console.log('Wake lock was released');
   }
console.log('wakeLock is active');
 } catch(e) {
  console.error(`${e.name}, ${e.message}`);
 }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client-Side Front end browser side enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant