Navigator: userActivation 속성

Baseline 2023
Newly available

Since November 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Navigator 인터페이스의 읽기 전용 속성인 userActivation 은 현재 활성화 되어있는 창의 사용자 활동 정보를 포함하는 UserActivation 객체를 반환합니다.

UserActivation는 객체입니다.

예제

사용자 동작이 최근에 수행되었는지 확인

UserActivation.isActive를 통해 사용자가 현재 임시 활성화로 상호작용 하는 중인지 확인할 수 있습니다.

js
if (navigator.userActivation.isActive) {
  // proceed to request playing media, for example
}

사용자 동작이 수행된 적이 있는지 확인

UserActivation.hasBeenActive를 통해 고정 활성화로 상호작용 된 적이 있는지 확인할 수 있습니다.

js
if (navigator.userActivation.hasBeenActive) {
  // proceed with auto-playing an animation, for example
}

명세서

Specification
HTML
# dom-navigator-useractivation

브라우저 호환성

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
userActivation

Legend

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

Full support
Full support
No support
No support

같이 보기