Web Push 背后有哪些技术?

What technologies behind Web Push?

我想知道Web Push背后有什么样的技术,比如https://goroost.com

效果如何?如何为 Web 推送配置我的服务器?我应该看什么?

我可以回答 WonderPush.com

首先,您需要注册WonderPush并申报您的网站。

然后,Copy/paste 结束 <body> 标记前的以下代码段:

<script>
(function(w, d, s, id, n){
  w[n] = w[n] || {q: [],
    init: function(o) {w[n].initOpts = o;},
    ready: function(c) {w[n].q.push(c);}};
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "https://cdn.by.wonderpush.com/sdk/1.1/wonderpush-loader.min.js";
  fjs.parentNode.insertBefore(js, fjs);
}(window, document, 'script', 'wonderpush-jssdk-loader','WonderPush'));

WonderPush.init({
  webKey: "[YOUR_WEBKEY]" // sign up for FREE to retrieve your web key
});
</script>

底层技术是Push API, combined with the Notifications API

您可以在 Google's developer docs. Note that currently push notifications are only supported in Google Chrome, but Microsoft and Mozilla 中阅读更多关于如何自己实施的信息,他们说他们很快就会实施。