Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Navigator

Navigator

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

* Some parts of this feature may have varying levels of support.

TheNavigator interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities.

ANavigator object can be retrieved using the read-onlywindow.navigator property.

Instance properties

Doesn't inherit any properties.

Standard properties

Navigator.bluetoothRead onlyExperimentalSecure context

Returns aBluetooth object for the current document, providing access toWeb Bluetooth API functionality.

Navigator.clipboardRead onlySecure context

Returns aClipboard object that provides read and write access to the system clipboard.

Navigator.connectionRead only

Returns aNetworkInformation object containing information about the network connection of a device.

Navigator.contactsRead onlyExperimentalSecure context

Returns aContactsManager interface which allows users to select entries from their contact list and share limited details of the selected entries with a website or application.

Navigator.cookieEnabledRead only

Returns false if setting a cookie will be ignored and true otherwise.

Navigator.credentialsRead onlySecure context

Returns theCredentialsContainer interface which exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.

Navigator.deviceMemoryRead onlySecure context

Returns the amount of device memory in gigabytes. This value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024.

Navigator.devicePostureRead onlyExperimental

Returns the browser'sDevicePosture object, which allows developers to query the device's current posture (that is, whether the viewport is in a flat or folded state) and run code in response to posture changes.

Navigator.geolocationRead only

Returns aGeolocation object allowing accessing the location of the device.

Navigator.gpuRead onlySecure context

Returns theGPU object for the current browsing context. The entry point for theWebGPU API.

Navigator.hardwareConcurrencyRead only

Returns the number of logical processor cores available.

Navigator.hidRead onlyExperimentalSecure context

Returns anHID object providing methods for connecting to HID devices, listing attached HID devices, and event handlers for connected HID devices.

Navigator.inkRead onlyExperimental

Returns anInk object for the current document, providing access toInk API functionality.

Navigator.keyboardRead onlyExperimentalSecure context

Returns aKeyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.

Navigator.languageRead only

Returns a string representing the preferred language of the user, usually the language of the browser UI. Thenull value is returned when this is unknown.

Navigator.languagesRead only

Returns an array of strings representing the languages known to the user, by order of preference.

Navigator.locksRead onlySecure context

Returns aLockManager object that provides methods for requesting a newLock object and querying for an existingLock object.

Navigator.loginRead onlySecure context

Provides access to the browser'sNavigatorLogin object, which a federated identity provider (IdP) can use to set a user's login status when they sign into or out of the IdP. SeeFederated Credential Management (FedCM) API for more details.

Navigator.maxTouchPointsRead only

Returns the maximum number of simultaneous touch contact points are supported by the current device.

Navigator.mediaCapabilitiesRead only

Returns aMediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.

Navigator.mediaDevicesRead onlySecure context

Returns a reference to aMediaDevices 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 usingMediaDevices.getUserMedia().

Navigator.mediaSessionRead only

ReturnsMediaSession 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.

Navigator.onLineRead only

Returns a boolean value indicating whether the browser is working online.

Navigator.pdfViewerEnabledRead only

Returnstrue if the browser can display PDF files inline when navigating to them, andfalse otherwise.

Navigator.permissionsRead only

Returns aPermissions object that can be used to query and update permission status of APIs covered by thePermissions API.

Navigator.presentationRead onlySecure context

Returns a reference to thePresentation API.

Navigator.schedulingRead onlyExperimental

Returns aScheduling object for the current document.

Navigator.serialRead onlyExperimentalSecure context

Returns aSerial object, which represents the entry point into theWeb Serial API to enable the control of serial ports.

Navigator.serviceWorkerRead onlySecure context

Returns aServiceWorkerContainer object, which provides access to registration, removal, upgrade, and communication with theServiceWorker objects for theassociated document.

Navigator.storageRead onlySecure context

Returns the singletonStorageManager object used for managing persistence permissions and estimating available storage on a site-by-site/app-by-app basis.

Navigator.usbRead onlySecure context

Returns aUSB object for the current document, providing access toWebUSB API functionality.

Navigator.userActivationRead only

Returns aUserActivation object containing information about the current window's user activation state.

Navigator.userAgentRead only

Returns the user agent string for the current browser.

Navigator.userAgentDataRead onlyExperimentalSecure context

Returns aNavigatorUAData object, which gives access to information about the browser and operating system of the user.

Navigator.virtualKeyboardRead onlyExperimentalSecure context

Returns a reference to theVirtualKeyboard API, to take control of the on-screen virtual keyboard.

Navigator.wakeLockRead onlySecure context

Returns aWakeLock interface you can use to request screen wake locks and prevent screen from dimming, turning off, or showing a screen saver.

Navigator.webdriverRead only

Indicates whether the user agent is controlled by automation.

Navigator.windowControlsOverlayRead onlySecure context

Returns theWindowControlsOverlay interface which exposes information about the geometry of the title bar in desktop Progressive Web Apps, and an event to know whenever it changes.

Navigator.xrRead onlyExperimentalSecure context

ReturnsXRSystem object, which represents the entry point into theWebXR API.

Non-standard properties

Navigator.buildIDRead onlyNon-standard

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.globalPrivacyControlRead onlyExperimental

Returns a boolean indicating a user's consent to their information being shared or sold.

Navigator.standaloneNon-standard

Returns a boolean indicating whether the browser is running in standalone mode. Available on Apple's iOS Safari only.

Deprecated properties

Navigator.activeVRDisplaysRead onlyDeprecatedNon-standard

Returns an array containing everyVRDisplay object that is currently presenting (VRDisplay.isPresenting istrue).

Navigator.appCodeNameRead only

Always returns'Mozilla', in any browser.

Navigator.appNameRead only

Always returns'Netscape', in any browser.

Navigator.appVersionRead only

Returns the version of the browser as a string. Do not rely on this property to return the correct value.

Navigator.doNotTrackRead onlyDeprecatedNon-standard

Reports the value of the user's do-not-track preference. When this value is "1", your website or application should not track the user.

Navigator.mimeTypesRead only

Returns anMimeTypeArray listing the MIME types supported by the browser.

Navigator.oscpuRead only

Returns a string that represents the current operating system.

Navigator.platformRead only

Returns a string representing the platform of the browser. Do not rely on this function to return a significant value.

Navigator.pluginsRead only

Returns aPluginArray listing the plugins installed in the browser.

Navigator.productRead only

Always returns'Gecko', in any browser.

Navigator.productSubRead only

Returns either the string'20030107', or'"20100101'.

Navigator.vendorRead only

Returns either the empty string,'Apple Computer Inc.', or'Google Inc.'.

Navigator.vendorSubRead only

Always returns the empty string.

Instance methods

Doesn't inherit any method.

Navigator.canShare()Secure context

Returnstrue if a call toNavigator.share() would succeed.

Navigator.clearAppBadge()Secure context

Clears a badge on the current app's icon and returns aPromise that resolves withundefined.

Navigator.deprecatedReplaceInURN()Experimental

Substitutes specified strings inside the mapped URL corresponding to a given opaque URN orFencedFrameConfig's internalurl property. This method has been made available as a temporary measure (hence "deprecated") to enable that substitution for fenced frame URLs, helping ad tech providers to migrate existing implementations across toprivacy sandbox APIs.

Navigator.getAutoplayPolicy()Experimental

Returns a value indicating whether the specified media element, audio context, or media feature "type" is allowed to autoplay.

Navigator.getBattery()Secure context

Returns a promise that resolves with aBatteryManager object that returns information about the battery charging status.

Navigator.getGamepads()

returns an array ofGamepad objects, one for each gamepad connected to the device.

Navigator.getInstalledRelatedApps()ExperimentalSecure context

Returns a promise that resolves with an array of objects representing any related native orProgressive Web Applications that the user has installed.

Navigator.registerProtocolHandler()Secure context

Allows websites to register themselves as a possible handler for a given protocol.

Navigator.requestMediaKeySystemAccess()Secure context

Returns aPromise for a MediaKeySystemAccess object.

Navigator.requestMIDIAccess()Secure context

Returns aPromise representing a request for access to MIDI devices on the user's system.

Navigator.sendBeacon()

Used to asynchronously transfer a small amount of data usingHTTP from the User Agent to a web server.

Navigator.setAppBadge()Secure context

Sets a badge on the icon associated with this app and returns aPromise that resolves withundefined.

Navigator.share()Secure context

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.

Navigator.unregisterProtocolHandler()Secure context

Unregister a website that is a handler for a given protocol.

Deprecated methods

Navigator.getUserMedia()DeprecatedSecure context

After having prompted the user for permission, returns the audio or video stream associated to a camera or microphone on the local computer.

Navigator.getVRDisplays()DeprecatedNon-standard

Returns a promise that resolves to an array ofVRDisplay objects representing any available VR devices connected to the computer.

Navigator.javaEnabled()

Always returns false.

Navigator.taintEnabled()

Returnsfalse. JavaScript taint/untaint functions removed in JavaScript 1.2.

Specifications

Specification
HTML
# the-navigator-object

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp