ServiceWorkerRegistration.active

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.

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

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

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

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

Syntax

js
sw = ServiceWorker.active;

Value

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

명세서

Specification
Service Workers
# navigator-service-worker-active

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
active

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also