Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. WorkerNavigator
  4. serviceWorker

WorkerNavigator: serviceWorker property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is only available inWeb Workers.

TheserviceWorker read-only property of theWorkerNavigator interface returns theServiceWorkerContainer object for theassociated document, which provides access to registration, removal, upgrade, and communication with theServiceWorker.

The feature may not be available in private mode.

Value

ServiceWorkerContainer.

Examples

This code checks if the browser supports using service worker in workers.

js
if ("serviceWorker" in navigator) {  // Supported!}

Specifications

Specification
Service Workers Nightly
# navigator-serviceworker

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp