From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/client/index.html | 131 ++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 files/zh-cn/web/api/client/index.html (limited to 'files/zh-cn/web/api/client/index.html') diff --git a/files/zh-cn/web/api/client/index.html b/files/zh-cn/web/api/client/index.html new file mode 100644 index 0000000000..33231d6ddf --- /dev/null +++ b/files/zh-cn/web/api/client/index.html @@ -0,0 +1,131 @@ +--- +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对象。

+ +

Methods

+ +
+
{{domxref("Client.postMessage()")}}
+
向client发送一条消息。
+
+ +

Properties

+ +
+
{{domxref("Client.id")}} {{readonlyInline}}
+
客户端的唯一通用标识符,字符串形式。
+
{{domxref("Client.type")}} {{readonlyInline}}
+
客户端的类型,字符串形式。可能是"window", "worker", 或 "sharedworker"。
+
{{domxref("Client.url")}} {{readonlyInline}}
+
客户端的URL,字符串形式。
+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Service Workers', '#client', 'Client')}}{{Spec2('Service Workers')}}Initial definition.
+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatChrome(40)}}{{ CompatGeckoDesktop("44.0") }}[1]{{CompatNo}}{{CompatOpera(27)}}{{CompatNo}}
type property{{CompatChrome(60)}}{{ CompatGeckoDesktop("54.0") }}{{CompatUnknown}}{{CompatOpera(47)}}{{CompatUnknown}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroid WebviewChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari 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}}
+ + + +

See also

+ + -- cgit v1.2.3-54-g00ecf