Client
        
        
          
                Baseline
                
                  Widely available
                
                
              
        
        
        
          
                
              
                
              
                
              
        
        
      
      This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2018年4月.
Client 接口表示一个可执行的上下文,如 Worker 或 SharedWorker。Window 客户端由更具体的 WindowClient 表示。你可以从 Clients.matchAll() 和 Clients.get() 等方法获取 Client/WindowClient 对象。
实例方法
Client.postMessage()- 
向客户端发送一条消息。
 
实例属性
Client.id只读- 
一个字符串,表示客户端的通用唯一标识。
 Client.type只读- 
表示客户端类型的字符串。可能是
"window"、"worker"或"sharedworker"。 Client.url只读- 
表示客户端 URL 的字符串。
 
规范
| Specification | 
|---|
| Service Workers> # client-interface>  | 
            
浏览器兼容性
Loading…