A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/API/FetchEvent/clientId below:

FetchEvent.clientId - Web API | MDN

MDN Web Docs
  1. 面向开发者的 Web 技术
  2. Web API
  3. FetchEvent
  4. FetchEvent.clientId

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

Filter sidebar

在本文中
  1. Service Worker API
  2. FetchEvent
  3. 构造函数
    1. FetchEvent()
  4. 实例属性
    1. clientId
    2. handled
    3. isReload 非标准 已弃用
    4. preloadResponse
    5. replacesClientId
    6. request
    7. resultingClientId
  5. 实例方法
    1. respondWith()
  6. 继承
    1. ExtendableEvent
    2. Event
  7. Service Workers API 的相关页面
    1. Cache
    2. CacheStorage
    3. Client
    4. Clients
    5. ExtendableEvent
    6. ExtendableMessageEvent
    7. InstallEvent
    8. NavigationPreloadManager
    9. Navigator.serviceWorker
    10. ServiceWorker
    11. ServiceWorkerContainer
    12. ServiceWorkerGlobalScope
    13. ServiceWorkerRegistration
    14. Window.caches
    15. WindowClient
    16. WorkerGlobalScope.caches
    17. WorkerNavigator.serviceWorker
  8. 指南
    1. 使用 Service Worker
在本文中 FetchEvent.clientId

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.

FetchEvent 接口的 clientId 只读属性,返回由当前 service worker 正在控制的 Client 的 id。

然后可以将此 ID 传递给 Clients.get() 方法以检索相关联的客户端。

值

一个字符串,表示客户端的 ID。

示例

js

self.addEventListener("fetch", (event) => {
  console.log(event.clientId);
});
规范 Specification Service Workers
# fetch-event-clientid
浏览器兼容性 参见 Help improve MDN Was this page helpful to you? Learn how to contribute

.

This page was last modified on 2023年7月30日 by MDN contributors.

View this page on GitHub

•

Report a problem with this content

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4