0

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.

4

1 回答 1

1

没有。

出于安全原因,浏览器内运行的任何内容都无法访问此类操作系统级别的命令。

仅仅弹出一个警告框是不行的。全屏也不行,无论如何,你不能在计时器上全屏。我刚刚尝试过,显然有浏览器保护措施。如果您请求全屏作为用户交互的直接结果,例如单击,则全屏没问题。但是,将完全相同的代码放入 setTimeout() 函数中,它就无法运行。

对于警报类型应用程序,您有两个选项:

1) 用声音来做。设置<audio>标签并将其设置为在 setTimeout 上播放。

2) Chrome 应用程序提供对不同事物的更多访问,这些事物比典型网页需要更高的安全性。我不知道他们是否允许足够的访问权限来做你想做的事,但你可以在这里阅读:http: //developer.chrome.com/apps/first_app.html

希望有帮助。

于 2013-09-10T08:12:14.253 回答