mdn / dom-examples

Code examples that accompany various MDN DOM and Web API documentation pages

Home Page:https://developer.mozilla.org/en-US/docs/Web/API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't make dom-examples/screen-wake-lock-api work

LuckCky opened this issue Β· comments

Hi!
Thanks for providing this example.
https://github.com/mdn/dom-examples/tree/master/screen-wake-lock-api

Expected Behavior

Button 'turn wake lock on' is active.
Text in the box 'wake lock status' is 'Screen Wake Lock API supported πŸŽ‰'

Current Behavior

Button 'turn wake lock on' is inactive.
Text in the box 'wake lock status' is 'Wake lock is not supported by this browser.'

Possible Solution

Unknown to me

Steps to Reproduce

  1. Debian 9 server
  2. nginx/1.10.3
  3. add three files from repo to /var/www/html
  4. set up Nginx to serve index.html
  5. Chrome Version 91.0.4472.114 (Official Build) (x86_64)
  6. No https (might it be an issue?)

No errors shown, just button is inactive.
How can I make it work as it's working in your demo (https://mdn.github.io/dom-examples/screen-wake-lock-api/)?

Bullet 6. is the problem indeed. The HTTPS requirement is mentioned in the article and the MDN docs. I just tried the demo on Chrome 91 and it worked.

Thanks, Thomas, that's my bad, I've missed this in the article.