W3cubDocs

/Haxe JavaScript

ServiceWorker

package js.html

extends EventTarget

@:native("ServiceWorker") Available on js

The ServiceWorker interface of the ServiceWorker API provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object.

Documentation ServiceWorker by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Variables

onerror:Function

onstatechange:Function

An EventListener property called whenever an event of type statechange is fired; it is basically fired anytime the ServiceWorker.state changes.

read only scriptURL:String

Returns the ServiceWorker serialized script URL defined as part of ServiceWorkerRegistration. The URL must be on the same origin as the document that registers the ServiceWorker.

read only state:ServiceWorkerState

Returns the state of the service worker. It returns one of the following values: installing, installed, activating, activated, or redundant.

Methods

postMessage (message:Dynamic, ?transferable:Array<Dynamic>):Void

Throws:

null DOMError

© 2005–2018 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/ServiceWorker.html