0

我使用 html5 通知创建了一个小应用程序,但似乎这些通知在某些情况下不起作用:

案例1:我留在页面上。通知工作。

案例 2:我切换到另一个应用程序(alt+tab)。Chrome 中的 Lst 活动页面是我的应用程序。通知工作。

案例 3:我切换到 Chrome 中的另一个选项卡,但没有关闭我的应用程序。在我切换回应用程序之前,不会显示任何通知。

这是正常行为还是我遇到了某种错误?我找不到太多关于它的文档。

PS:在 Centos 6 上运行 Chrome 仅供参考

4

1 回答 1

0

The Chromium API Specification reads that

If the page which generates a notification was generated is closed, the notification itself will not be closed, but events will not be delivered, as the script execution context is no longer present.

If that doesn't cover it, this page has more technical detail about how it is implemented in Chromium

于 2012-09-20T10:24:32.200 回答