BroadcastChannel.name

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.

BroadcastChannel.name 읽기 전용 속성은 지정된 채널의 이름을 고유하게 식별하는 문자열을 반환합니다. 이 이름은 생성 시 BroadcastChannel() 생성자에 전달되므로 읽기 전용입니다.

참고 : 이 기능은 Web Worker에서 사용할 수 있습니다.

문자열.

예제

js
// 채널에 연결
const bc = new BroadcastChannel("test_channel");

// postMessage 등의 동작들...

// 채널 이름을 콘솔에 로깅
console.log(bc.name); // "test_channel"

// 완료되면 채널 연결 해제
bc.close();

명세서

Specification
HTML
# dom-broadcastchannel-name-dev

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
name

Legend

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

Full support
Full support
No support
No support
User must explicitly enable this feature.

같이 보기