Service Worker 是否可以通过推送事件进行更新?

Can a service worker be updated thanks to a push event?

我知道问题是第一个提出的here and lately discussed there:

I think we should define that:

[...]

We do a "update check" any time a SW handles an non-fetch/non-message event, such as events for an incoming push message or geofencing message. These might not trigger a navigation so it's important that these also do update checks.

[...]

When we fire an event in the SW, we should trigger a soft update if we haven't done one within 24hrs

W3C 规范对我来说有点模糊 (SW Update, SW Soft Update),截至今天,服务工作者可以在推送事件后更新吗? Chrome/Firefox/Safari 是否遵循相同的行为

在 Firefox 中,答案是肯定的。它是在这里实现的:https://bugzilla.mozilla.org/show_bug.cgi?id=1207727. You can inspect the changeset, in particular in the ServiceWorkerPrivate.cpp file here: https://bugzilla.mozilla.org/page.cgi?id=splinter.html&bug=1207727&attachment=8678641.

Safari 不支持服务工作者或推送 API,所以这里的答案是否定的。