From a02f4b2f60c81e09b318a090e5c9c2d2d641c878 Mon Sep 17 00:00:00 2001 From: t7yang Date: Sat, 17 Jul 2021 16:10:02 +0800 Subject: replace wiki links in zh-CN --- files/zh-cn/web/api/extendableevent/waituntil/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-cn/web/api/extendableevent/waituntil/index.html') diff --git a/files/zh-cn/web/api/extendableevent/waituntil/index.html b/files/zh-cn/web/api/extendableevent/waituntil/index.html index 8e48586b67..919ceac2c6 100644 --- a/files/zh-cn/web/api/extendableevent/waituntil/index.html +++ b/files/zh-cn/web/api/extendableevent/waituntil/index.html @@ -7,9 +7,9 @@ translation_of: Web/API/ExtendableEvent/waitUntil

ExtendableEvent.waitUntil() 方法告诉事件分发器该事件仍在进行。这个方法也可以用于检测进行的任务是否成功。在服务工作线程中,这个方法告诉浏览器事件一直进行,直至 promise 解决,浏览器不应该在事件中的异步操作完成之前终止服务工作线程。

-

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/install_event", "install")}} 事件使用 waitUntil() 来将服务工作线程保持在 {{domxref("ServiceWorkerRegistration.installing", "installing")}} 阶段。如果传入 waitUntil() 的 promise 被拒绝,则将此次安装视为失败,丢弃这个服务工作线程。这主要用于确保在服务工作线程安装以前,所有依赖的核心缓存都已经成功载入。

+

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/install_event", "install")}} 事件使用 waitUntil() 来将服务工作线程保持在 {{domxref("ServiceWorkerRegistration.installing", "installing")}} 阶段。如果传入 waitUntil() 的 promise 被拒绝,则将此次安装视为失败,丢弃这个服务工作线程。这主要用于确保在服务工作线程安装以前,所有依赖的核心缓存都已经成功载入。

-

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/activate_event", "activate")}} 事件使用 waitUntil() 来延迟函数事件,如 fetch 和 push,直至传入 waitUntil() 的 promise 被解决。这让服务工作线程有时间更新数据库架构(database schema)和删除过时缓存({{domxref("Cache", "caches")}}),让其他事件能在一个完成更新的状态下进行。

+

服务工作线程(service workers)中的 {{domxref("ServiceWorkerGlobalScope/activate_event", "activate")}} 事件使用 waitUntil() 来延迟函数事件,如 fetch 和 push,直至传入 waitUntil() 的 promise 被解决。这让服务工作线程有时间更新数据库架构(database schema)和删除过时缓存({{domxref("Cache", "caches")}}),让其他事件能在一个完成更新的状态下进行。

 waitUntil() 方法最初必须在事件回调里调用,在此之后,方法可以被调用多次,直至所有传入的 promise 被解决。

-- cgit v1.2.3-54-g00ecf