Navigator: serviceWorker プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.
Navigator.serviceWorker
は読み取り専用のプロパティで、 ServiceWorkerContainer
オブジェクトを返します。これは関連付けられた文書で ServiceWorker
の登録、削除、更新、通信へのアクセスを提供します。
この機能はプライベートモードでは利用できない可能性があります。
値
例
このコードは、ブラウザーがサービスワーカーに対応しているかをチェックします。
js
if ("serviceWorker" in navigator) {
// Supported!
}
仕様書
Specification |
---|
Service Workers # navigator-service-worker-attribute |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
serviceWorker |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.