From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../skipwaiting/index.html | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 files/ko/web/api/serviceworkerglobalscope/skipwaiting/index.html (limited to 'files/ko/web/api/serviceworkerglobalscope/skipwaiting') diff --git a/files/ko/web/api/serviceworkerglobalscope/skipwaiting/index.html b/files/ko/web/api/serviceworkerglobalscope/skipwaiting/index.html new file mode 100644 index 0000000000..a6c3e50e96 --- /dev/null +++ b/files/ko/web/api/serviceworkerglobalscope/skipwaiting/index.html @@ -0,0 +1,71 @@ +--- +title: ServiceWorkerGlobalScope.skipWaiting() +slug: Web/API/ServiceWorkerGlobalScope/skipWaiting +translation_of: Web/API/ServiceWorkerGlobalScope/skipWaiting +--- +
{{APIRef("Service Workers API")}}
+ +

{{domxref("ServiceWorkerGlobalScope")}} 의 ServiceWorkerGlobalScope.skipWaiting() 메소드는 waiting 상태의 서비스 워커를 active 상태의 서비스 워커로 변경하도록 강제한다.

+ +

근본적인 서비스 워커에 대한 업데이트들이 현재의 클라이언트와 다른 모든 active 클라이언트들에게 즉시 적용되도록 하기 위해 {{domxref("Clients.claim()")}} 과 이 메소드를 사용한다.

+ +

Syntax

+ +
ServiceWorkerGlobalScope.skipWaiting().then(function() {
+  //Do something
+});
+ +

Returns

+ +

undefined 로 즉시 resolve 되는 {{jsxref("Promise")}}

+ +

Example

+ +

서비스 워커가 실행되는 동안 언제라도 self.skipWaiting() 는 호출될 수 있지만, 이것은 waiting 상태로 남아 있을 수도 있는 새롭게 설치된 서비스 워커가 있는 경우에만 영향을 줄 수 있다. 따라서, {{domxref("InstallEvent")}} 핸들러 내부에서 self.skipWaiting() 을 호출하는 것이 일반적이다.

+ +

다음 예시는 active 상태의 서비스 워커가 이미 존재하는지의 여부에 관계없이, 새로 설치된 서비스 워커가  activating 상태로 진행되도록 한다.

+ +
self.addEventListener('install', function(event) {
+  // skipWaiting()가 반환하는 promise는 안전하게 무시될 수 있다.
+  self.skipWaiting();
+
+  // 잠재적으로 event.waitUntil(); 내부에서
+  // 서비스 워커 설치를 위해 필요한 다른 action 들을 수행하라.
+});
+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Service Workers', '#service-worker-obj', 'ServiceWorker')}}{{Spec2('Service Workers')}}Initial definition.
+ +

Browser compatibility

+ +
+ + +

{{Compat("api.ServiceWorkerGlobalScope.skipWaiting")}}

+
+ +

See also

+ + -- cgit v1.2.3-54-g00ecf