فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("Service Workers API")}}{{AvailableInWorkers("service")}}

The Client interface represents an executable context such as a {{domxref("Worker")}}, or a {{domxref("SharedWorker")}}. {{domxref("Window")}} clients are represented by the more-specific {{domxref("WindowClient")}}. You can get Client/WindowClient objects from methods such as {{domxref("Clients.matchAll","Clients.matchAll()")}} and {{domxref("Clients.get","Clients.get()")}}.

Instance properties

  • {{domxref("Client.frameType")}} {{ReadOnlyInline}}
  • : The client's frame type as a string. It can be "auxiliary", "top-level", "nested", or "none".
  • {{domxref("Client.id")}} {{ReadOnlyInline}}
  • : The universally unique identifier of the client as a string.
  • {{domxref("Client.type")}} {{ReadOnlyInline}}
  • : The client's type as a string. It can be "window", "worker", or "sharedworker".
  • {{domxref("Client.url")}} {{ReadOnlyInline}}
  • : The URL of the client as a string.

Instance methods

  • {{domxref("Client.postMessage()")}}
  • : Sends a message to the client.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • Using Service Workers