我可以使用网络推送通知来更新页面而不显示通知吗? [英] Can I use web push notifications to update the page without displaying a notification?

查看:67
本文介绍了我可以使用网络推送通知来更新页面而不显示通知吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用网络推送通知 更新网页而不显示用户与之交互的通知.本质上,我想在服务器上发生事件后刷新数据.

I am wondering if I can use web push notifications to update a web page without displaying a notification for the user to interact with. Essentially I want to refresh data after an event on the server.

如果可以,是否还需要获得用户的许可才能发送这些推送更新?

If this is possible, is it still necessary to receive permission from the user to send these push updates?

推荐答案

是的,您可以在不显示通知的情况下发送推送消息,但 Firefox 和 Chrome 对不可见"推送消息的原始数量和您发送它们的速率.

Yes, you can send push messages without showing a notification, but there are limitations on both Firefox and Chrome on the raw number of "invisible" push messages and the rate at which you send them.

您可以使用推送配额 ServiceWorker Cookbook 示例在不同浏览器中对配额进行一些试验.

You can experiment a bit with the quotas in different browers using the Push Quota ServiceWorker Cookbook example.

这篇关于我可以使用网络推送通知来更新页面而不显示通知吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆