This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

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

브라우저 호환성

같이 보기