ServiceWorkerRegistration.active

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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

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

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

Syntax

sw = ServiceWorker.active 

Value

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

Specifications

Specification Status Comment
Service Workers
The definition of 'ServiceWorkerRegistration.active' in that specification.
Working Draft Initial definition.
 

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
active
Experimental
Chrome Full support 40Edge Full support 17
Full support 17
Full support 16
Disabled
Disabled From version 16: this feature is behind the Enable service workers preference.
Firefox Full support 44
Notes
Full support 44
Notes
Notes Service workers (and Push) have been disabled in the Firefox 45 and 52 Extended Support Releases (ESR).
IE No support NoOpera Full support 27Safari Full support 11.1WebView Android Full support 40Chrome Android Full support 40Firefox Android Full support 44Opera Android Full support 27Safari iOS Full support 11.1Samsung Internet Android Full support 4.0

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.

See also