iPad 屏幕锁定时如何运行 JavaScript 事件?
我正在为 iPad 开发 HTML5 警报,但我注意到当屏幕进入待机状态(或被用户阻止)时,Safari 会阻止所有事件。我尝试了setTimeout()
。
怎么解决?
我只需要在一段时间后刷新页面或运行 .mp3
即可。
I am developing an alarm in HTML5 for iPad, but I noticed that when the screen goes into standby (or is blocked by the user), Safari blocks all events. I tried setTimeout()
.
How to solve?
I just need to refresh the page or run a .mp3
after a certain period of time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
那是不可能的。当设备处于睡眠模式时,Safari 会进入睡眠状态。
在 iPhone 睡眠模式下运行计时器(没有 JavaScript)?
That's not possible. Safari goes to sleep when the device is in sleep mode.
Running Timer in iPhone Sleep mode (with no javascript)?
Afaik,您需要一个本机应用程序。
You'd need a native app for this, AFAIK.