33

Apple 在 Safari Technology Preview 46 默认开启 Service Worker - w3ctech

 6 years ago
source link: https://www.w3ctech.com/topic/2083?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Apple 在 Safari Technology Preview 46 默认开启 Service Worker

  • 2017-12-21
  • 7062 访问
  • 0

2017 年 7 月 14 日,Apple 的 Safari 团队开始 Service Worker 的开发。经过 5 个月的努力,Apple 在 Safari Technology Preview 46 默认开启 Service Worker。

https://webkit.org/wp-content/uploads/safari-150x150.png

Safari Technology Preview是由Apple发布的适用于OS X的Safari版本,其中包括WebKit浏览器引擎的尖端开发版本。

换言之,我们可以在 mac 的 safari 上体验 PWA 了。

本次发布和 Service Worker 相关的主要内容如下:

  • 默认支持 Service Worker
  • 在 Service Worker 内部可以访问 self.registration
  • 在 Service Worker 内部可以处理 self.skipWaiting
  • 实现了 clients.get()clients.getAll()
  • 在 Service Worker 中支持 container.register()registration.unregister()
  • 在 Service Worker 中激活了 indexedDB 和 Web Sockets
  • 在 Service Worker 中支持了 container.getRegistration()container.getRegistrations()
  • 在 Service Worker 中支持 serviceWorker.postMessage()serviceWorkerRegistration.update()

以上是主要引入的新功能。其实还有很多是 bugfix 或者比较细致的功能描述。就不一一翻译了。

可以看到 Safari 已经对一些基础 api 开始进行支持了。

于是笔者也按捺不住激动使用 ispwaready.toxicjohann.com 测试了一下。

虽然得分还是比较低。。但是相比于 safari 已经是很大的进步了。

更多的相关信息可以阅读原文https://webkit.org/blog/8042/release-notes-for-safari-technology-preview-46/.

如果你也想体验,欢迎从 https://webkit.org/downloads/ 中下载。

另外,edge 也于昨天在 build 17063 中启用 Service Worker。详情见原文https://developer.microsoft.com/en-us/microsoft-edge/platform/changelog/desktop/17063/?compareWith=16299

w3ctech微信

扫码关注w3ctech微信公众号

共收到0条回复


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK