Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Experimental WebAPI
GitHub

ServiceWorkerAPI

Types

client

The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient.See Client on MDN

typeclient= {id:string,url:string}

Record fields

clients

The Clients interface provides access to Client objects. Access it via self.clients within a service worker.See Clients on MDN

typeclients

Module

There are methods and helpers defined in Clients.

navigationPreloadManager

typenavigationPreloadManager= {}

Module

There are methods and helpers defined in NavigationPreloadManager.

navigationPreloadState

typenavigationPreloadState= {
mutableenabled?:bool,
mutableheaderValue?:string,
}

Record fields

enabled
option< bool >
headerValue
option< string >

registrationOptions

typeregistrationOptions= {
mutablescope?:string,
mutabletype_?:workerType,
mutableupdateViaCache?:serviceWorkerUpdateViaCache,
}

Record fields

scope
option< string >
type_
option<workerType >
updateViaCache

requestInfo

typerequestInfo=WebAPI.Prelude.any

serviceWorker

This ServiceWorker API interface 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.See ServiceWorker on MDN

typeserviceWorker= {
scriptURL:string,
state:serviceWorkerState,
}

Record fields

scriptURL
string

Module

There are methods and helpers defined in ServiceWorker.

serviceWorkerContainer

The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations.See ServiceWorkerContainer on MDN

typeserviceWorkerContainer= {
controller:Null.t<serviceWorker>,
ready:promise<serviceWorkerRegistration>,
}

Record fields

controller
Null.t<serviceWorker >

Module

There are methods and helpers defined in ServiceWorkerContainer.

serviceWorkerGlobalScope

The ServiceWorkerGlobalScope interface of the Service Worker API represents the global execution context of a service worker.See ServiceWorkerGlobalScope on MDN

typeserviceWorkerGlobalScope= {
caches:WebAPI.WebWorkersAPI.cacheStorage,
crossOriginIsolated:bool,
clients:clients,
registration:serviceWorkerRegistration,
}

Record fields

crossOriginIsolated
bool

Module

There are methods and helpers defined in ServiceWorkerGlobalScope.

serviceWorkerRegistration

This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin.See ServiceWorkerRegistration on MDN

typeserviceWorkerRegistration= {
installing:Null.t<serviceWorker>,
waiting:Null.t<serviceWorker>,
active:Null.t<serviceWorker>,
navigationPreload:navigationPreloadManager,
scope:string,
updateViaCache:serviceWorkerUpdateViaCache,
pushManager:WebAPI.PushAPI.pushManager,
}

Record fields

installing
Null.t<serviceWorker >
scope
string

Module

There are methods and helpers defined in ServiceWorkerRegistration.

serviceWorkerState

typeserviceWorkerState=
| @as("activated")Activated
| @as("activating")Activating
| @as("installed")Installed
| @as("installing")Installing
| @as("parsed")Parsed
| @as("redundant")Redundant

serviceWorkerUpdateViaCache

typeserviceWorkerUpdateViaCache=
| @as("all")All
| @as("imports")Imports
| @as("none")None

windowClient

The WindowClient interface of the ServiceWorker API represents the scope of a service worker client that is a document in a browsing context, controlled by an active worker.See WindowClient on MDN

typewindowClient= {id:string,url:string}

Record fields

workerType

typeworkerType=
| @as("classic")Classic
| @as("module")Module

[8]ページ先頭

©2009-2025 Movatter.jp