Navigator

Navigator 인터페이스는 사용자 에이전트의 상태와 신원 정보를 나타냅내며, 스크립트로 해당 정보를 질의할 때와 애플리케이션을 특정 활동에 등록할 때 사용합니다.

Navigator 객체는 window.navigator 읽기 전용 속성으로 접근할 수 있습니다.

속성

표준 속성

Navigator.connection Read only This is an experimental API that should not be used in production code.
장치의 네트워크 연결 정보를 담은 NetworkInformation 객체를 반환합니다.
Navigator.cookieEnabled Read only
쿠키 설정을 할 수 있으면 참, 아니면 거짓을 반환합니다.
Navigator.credentials Read only
사용자 인증 정보를 요청하고, 로그인과 회원가입 등 중요한 이벤트의 발생을 사용자 에이전트에 알려줄 수 있는 CredentialsContainer 인터페이스를 반환합니다.
Navigator.deviceMemory Read only This is an experimental API that should not be used in production code.
장치의 메모리를 기가바이트 단위로 반환합니다. 근삿값으로서, 실제 값을 가장 가까운 2의 배수로 반올림한 후에 1024로 나눠서 제공합니다.
Navigator.doNotTrack Read only This is an experimental API that should not be used in production code.
사용자의 추적 거부 설정 값을 반환합니다. 값이 "yes"면 웹 사이트 또는 앱에서 사용자를 추적하지 않아야 합니다.
Navigator.geolocation Read only
장치의 위치 정보에 접근할 수 있는 Geolocation 객체를 반환합니다.
NavigatorConcurrentHardware.hardwareConcurrency Read only
중앙처리장치의 사용 가능한 논리 코어 수를 반환합니다.
NavigatorPlugins.javaEnabled Read only
호스트 브라우저에서 Java를 사용 가능한지 나타냅니다.
Navigator.keyboard Read only This is an experimental API that should not be used in production code.
Returns a Keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
NavigatorLanguage.language Read only
사용자의 선호 언어(주로 브라우저 UI 언어)를 나타내는 DOMString을 반환합니다. 언어를 알 수 없는 경우 null을 반환합니다.
NavigatorLanguage.languages Read only This is an experimental API that should not be used in production code.
사용자에게 알려진 언어 목록을 나타내는 DOMString 배열을 반환합니다. 정렬 순서는 사용자의 언어 선호도입니다.
Navigator.locks Read only This is an experimental API that should not be used in production code.
새로운 Lock 객체를 요청하거나, 기존 Lock 객체를 질의할 수 있는 LockManager 객체를 반환합니다.
Navigator.maxTouchPoints Read only
현재 장치에서 지원하는 최대 동시 터치 지점의 수를 반환합니다.
Navigator.mediaCapabilities Read only This is an experimental API that should not be used in production code.
주어진 형식과 출력 형태에 대한 인코딩 및 디코딩 능력을 알아낼 수 있는 MediaCapabilities 객체를 반환합니다.
Navigator.mediaDevices Read only
Returns a reference to a MediaDevices object which can then be used to get information about available media devices (MediaDevices.enumerateDevices()), find out what constrainable properties are supported for media on the user's computer and user agent (MediaDevices.getSupportedConstraints()), and to request access to media using MediaDevices.getUserMedia().
Navigator.mediaSession Read only This is an experimental API that should not be used in production code.
Returns MediaSession object which can be used to provide metadata that can be used by the browser to present information about the currently-playing media to the user, such as in a global media controls UI.
NavigatorPlugins.mimeTypes Read only
Returns an MimeTypeArray listing the MIME types supported by the browser.
Navigator.onLine Read only
Returns a Boolean indicating whether the browser is working online.
Navigator.permissions Read only This is an experimental API that should not be used in production code.
Returns a Permissions object that can be used to query and update permission status of APIs covered by the Permissions API.
NavigatorPlugins.plugins Read only
Returns a PluginArray listing the plugins installed in the browser.
Navigator.presentation Read only This is an experimental API that should not be used in production code.
Returns a reference to the Presentation API.
Navigator.serviceWorker Read only
Returns a ServiceWorkerContainer object, which provides access to registration, removal, upgrade, and communication with the ServiceWorker objects for the associated document.
NavigatorStorage.storage Read only
Returns the singleton StorageManager object used for managing persistence permissions and estimating available storage on a site-by-site/app-by-app basis.
NavigatorID.userAgent Read only
Returns the user agent string for the current browser.
Navigator.vendor Read only
Returns the vendor name of the current browser (e.g., "Netscape6").
Navigator.webdriver Read only This is an experimental API that should not be used in production code.
Indicates whether the user agent is controlled by automation.
Navigator.xr Read only This is an experimental API that should not be used in production code.
Returns XR object, which represents the entry point into the WebXR API.

비표준 속성

Navigator.buildID This API has not been standardized.
Returns the build identifier of the browser. In modern browsers this property now returns a fixed timestamp as a privacy measure, e.g. 20181001000000 in Firefox 64 onwards.
Navigator.securitypolicy This API has not been standardized.
Returns an empty string. In Netscape 4.7x, returns "US & CA domestic policy" or "Export policy".
Navigator.standalone This API has not been standardized.
Returns a boolean indicating whether the browser is running in standalone mode. Available on Apple's iOS Safari only.
Navigator.wakeLock Read only This API has not been standardized.
Returns a WakeLock interface you can use to request screen wake locks and prevent screen from dimming, turning off, or showing a screen saver.

메서드

아무 메서드도 상속하지 않지만, NavigatorID, NavigatorContentUtils, NavigatorUserMedia, NavigatorStorageUtils가 정의하는 메서드를 구현합니다.

Navigator.canShare()
Returns true if a call to Navigator.share() would succeed.
Navigator.registerProtocolHandler()
Allows web sites to register themselves as a possible handler for a given protocol.
Navigator.requestMediaKeySystemAccess()
Returns a Promise for a MediaKeySystemAccess object.
Navigator.sendBeacon()
Used to asynchronously transfer a small amount of data using HTTP from the User Agent to a web server.
Navigator.share()
Invokes the native sharing mechanism of the current platform.
Navigator.vibrate()
Causes vibration on devices with support for it. Does nothing if vibration support isn't available.

명세

브라우저 호환성

BCD tables only load in the browser