Question

Weird question !

I was wondering if there was any action a website could do to make the user's screensaver disappear.

I wanted to create kind of an alarm-clock website, but with nice visual effects, and I wished I could make the user leave their screensaver.

Is there any action that wakes up the computer ? Like, I don't know, making the website fullscreen, moving the window around.. Or is the screensaver only and exclusively left through keyboard/mouse events ?

I've read that you can't interact with the screensaver with JS : javascript code to prevent screensaver from starting

But I was hoping something like putting the website fullscreen would wake the computer up.

Was it helpful?

Solution

Nope.

For security reasons, nothing running inside the browser has access to OS-level commands like that.

Simply popping up an alert box won't do it. Going full screen won't work either, and anyway, you can't go full screen on a timer. I just tried and and apparently there are browsers safeguards against it. If you request full screen as a direct result of user interaction like, for example, a click, it goes full screen no problem. But, put the exact same code inside a setTimeout() function and it just doesn't run.

You have two options for an alarm type application:

1) Just do it with sound. Set up an <audio> tag and set it to play on a setTimeout.

2) Chrome apps offer greater access to different things that require more security than a typical web page. I don't know if they allow enough access to do what you're wanting to do, but you can read about it here: http://developer.chrome.com/apps/first_app.html

Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top