--- title: Client slug: Web/API/Client tags: - API - Client - Experimental - Interface - NeedsTranslation - Reference - Service Workers - ServiceWorkerClient - ServiceWorkers - TopicStub translation_of: Web/API/Client ---
{{SeeCompatTable}}{{APIRef("Service Workers API")}}
Client
接口表示一个可执行的上下文,如{{domxref("Worker")}}或{{domxref("SharedWorker")}}。{{domxref("Window")}} 客户端由更具体的{{domxref("WindowClient")}}表示。 你可以从{{domxref("Clients.matchAll","Clients.matchAll()")}} 和{{domxref("Clients.get","Clients.get()")}}等方法获取Client
/WindowClient
对象。
window"
, "worker"
, 或 "sharedworker"。
Specification | Status | Comment |
---|---|---|
{{SpecName('Service Workers', '#client', 'Client')}} | {{Spec2('Service Workers')}} | Initial definition. |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{CompatChrome(40)}} | {{ CompatGeckoDesktop("44.0") }}[1] | {{CompatNo}} | {{CompatOpera(27)}} | {{CompatNo}} |
type property |
{{CompatChrome(60)}} | {{ CompatGeckoDesktop("54.0") }} | {{CompatUnknown}} | {{CompatOpera(47)}} | {{CompatUnknown}} |
Feature | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatChrome(40)}} | {{CompatChrome(40)}} | {{ CompatGeckoMobile("44.0") }} | {{CompatNo}} | {{CompatOperaMobile(27)}} | {{CompatNo}} |
type property |
{{CompatChrome(60)}} | {{CompatChrome(60)}} | {{ CompatGeckoMobile("54.0") }} | {{CompatUnknown}} | {{CompatOperaMobile(47)}} | {{CompatUnknown}} |