News for hackers. Stuff that matters.
Re:Clock by camillomiller on Wednesday April 19, 2023 @06:32AM (#35626491)
Wow pretty cool. I thought you couldn't automatically set an app as full screen without a prompt? How did you do that?
Re:Clock by gondaloof on Wednesday April 19, 2023 @07:24AM (#35626850)
You don't need a prompt, you just need user interaction, which in this case is click, tap or key press.
Re:Clock by rpastuszak on Wednesday April 19, 2023 @10:49AM (#35628827)
Yup, that's one of the reasons I added the intro modal with a call-to-action:)

The handler triggering full screen (el.requestFullscreen) needs to be in the same call stack as a user interaction event. Same with triggering audio playback programmatically.

I'm actually using audio as a fallback to prevent the device from falling asleep (via nosleep.js, modern APIs do exist, but I don't trust Apple with PWAs).