Send desktop notifications in Chrome or Firefox from a closed web app?

*爱你&永不变心* 提交于 2019-11-27 10:16:11
Rob W

You can send push notifications even when your web page is not active using Service Workers, the Notification API for service workers and the push API for server-initiated notifications (or scheduled notifications).

As of June 2016, Service Workers are supported in Chrome, Firefox and Opera. See the status at https://jakearchibald.github.io/isserviceworkerready/

See the following links for related discussions, status of implementation and specifications.

You can do exactly what you are looking for using the W3C Push API.

If you want to build everything from scratch I suggest to start reading this tutorial by Google. It is for Chrome, but Firefox works in a very similar way.

However it's a lot of work and the "standard" is still evolving: I suggest that you use a service like Pushpad (I am the founder).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!