ServiceWorker

Overview

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.

Location

 

onmessage    (declared in Worker)

 

property onmessage: EventListener read write;

 

EventListener onmessage { get; set; }

 

var onmessage: EventListener { get{} set{} }

 

EventListener onmessage { __get; __set; }

 

Property onmessage() As EventListener

onmessageerror    (declared in Worker)

 

property onmessageerror: EventListener read write;

 

EventListener onmessageerror { get; set; }

 

var onmessageerror: EventListener { get{} set{} }

 

EventListener onmessageerror { __get; __set; }

 

Property onmessageerror() As EventListener

onstatechange

 

property onstatechange: EventListener read write;

 

EventListener onstatechange { get; set; }

 

var onstatechange: EventListener { get{} set{} }

 

EventListener onstatechange { __get; __set; }

 

Property onstatechange() As EventListener

postMessage    (declared in Worker)

Sends a message — consisting of any JavaScript object — to the worker's inner scope.

 

method postMessage(parmessage: dynamic; partransfer: dynamic): dynamic

 

dynamic postMessage(dynamic parmessage, dynamic partransfer)

 

func postMessage(_ parmessage: dynamic, _ partransfer: dynamic) -> dynamic

 

dynamic postMessage(dynamic parmessage, dynamic partransfer)

 

Function postMessage(parmessage As dynamic, partransfer As dynamic) As dynamic

Parameters:

  • parmessage:
  • partransfer:

scriptURL

 

property scriptURL: String read;

 

String scriptURL { get; }

 

var scriptURL: String { get{} }

 

String scriptURL { __get; }

 

ReadOnly Property scriptURL() As String

state

 

property state: ServiceWorkerState read;

 

ServiceWorkerState state { get; }

 

var state: ServiceWorkerState { get{} }

 

ServiceWorkerState state { __get; }

 

ReadOnly Property state() As ServiceWorkerState

 

onmessage    (declared in Worker)

 

property onmessage: EventListener read write;

 

EventListener onmessage { get; set; }

 

var onmessage: EventListener { get{} set{} }

 

EventListener onmessage { __get; __set; }

 

Property onmessage() As EventListener

onmessageerror    (declared in Worker)

 

property onmessageerror: EventListener read write;

 

EventListener onmessageerror { get; set; }

 

var onmessageerror: EventListener { get{} set{} }

 

EventListener onmessageerror { __get; __set; }

 

Property onmessageerror() As EventListener

onstatechange

 

property onstatechange: EventListener read write;

 

EventListener onstatechange { get; set; }

 

var onstatechange: EventListener { get{} set{} }

 

EventListener onstatechange { __get; __set; }

 

Property onstatechange() As EventListener

scriptURL

 

property scriptURL: String read;

 

String scriptURL { get; }

 

var scriptURL: String { get{} }

 

String scriptURL { __get; }

 

ReadOnly Property scriptURL() As String

state

 

property state: ServiceWorkerState read;

 

ServiceWorkerState state { get; }

 

var state: ServiceWorkerState { get{} }

 

ServiceWorkerState state { __get; }

 

ReadOnly Property state() As ServiceWorkerState

 

postMessage    (declared in Worker)

Sends a message — consisting of any JavaScript object — to the worker's inner scope.

 

method postMessage(parmessage: dynamic; partransfer: dynamic): dynamic

 

dynamic postMessage(dynamic parmessage, dynamic partransfer)

 

func postMessage(_ parmessage: dynamic, _ partransfer: dynamic) -> dynamic

 

dynamic postMessage(dynamic parmessage, dynamic partransfer)

 

Function postMessage(parmessage As dynamic, partransfer As dynamic) As dynamic

Parameters:

  • parmessage:
  • partransfer: