ServiceWorkerRegistration.active

실험적: 이 기능은 실험적인 기능입니다.
프로덕션 환경에서 사용하기 전에 브라우저 호환성 표를 주의 깊게 확인하세요.

ServiceWorkerRegistration (en-US) 인터페이스의 active 속성은 ServiceWorker.state (en-US)activating 또는 activated 상태인 서비스 워커를 반환한다. 이 속성은 null 로 초기 설정되어 있다.

클라이언트들의 URL이 등록 scope 내에 있을 경우 active 워커는 ServiceWorkerClient (en-US) 를 제어한다. (ServiceWorkerContainer.register (en-US) 가 처음으로 호출될 때 그 scope 옵션은 정의된다.)

참고: 이 기능은 Web Workers 에서 사용 가능하다.

Syntax

js
sw = ServiceWorker.active;

Value

현재 activating 또는 activated 상태에 있다면, ServiceWorker 객체.

명세서

Specification
Service Workers
# navigator-service-worker-active

브라우저 호환성

BCD tables only load in the browser

See also