Clients: get() 메서드

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.

참고 : This feature is only available in Service Workers.

Clients 인터페이스의 get() 메서드는 주어진 id와 일치하는 서비스 워커 클라이언트를 가져와 Promise로 반환합니다.

구문

js
get(id)

매개변수

id

가져오려고 하는 클라이언트의 아이디를 나타내는 문자열.

반환 값

Client 객체나 undefined로 이행된 Promise.

예제

js
self.clients.get(id).then((client) => {
  self.clients.openWindow(client.url);
});

명세서

Specification
Service Workers
# clients-get

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
get

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support