Firefox Tomorrow

web api interface

Navigator

View on MDN ↗

The Navigator 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.

A Navigator object can be retrieved using the read-only navigator property.

Instance properties

Doesn’t inherit any properties.

Standard properties

  • audioSession Read only Experimental
    • : Returns an AudioSession object that can be used to control how audio from the web application interacts with other audio playing on the device.
  • bluetooth Read only Experimental
  • clipboard Read only
    • : Returns a Clipboard object that provides read and write access to the system clipboard.
  • connection Read only
    • : Returns a NetworkInformation object containing information about the network connection of a device.
  • contacts Read only Experimental
    • : Returns a ContactsManager interface which allows users to select entries from their contact list and share limited details of the selected entries with a website or application.
  • cookieEnabled Read only
    • : Returns false if setting a cookie will be ignored and true otherwise.
  • credentials Read only
    • : Returns the CredentialsContainer interface which exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
  • deviceMemory Read only
    • : 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.
  • devicePosture Read only Experimental
    • : Returns the browser’s DevicePosture 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.
  • geolocation Read only
    • : Returns a Geolocation object allowing accessing the location of the device.
  • gpu Read only
    • : Returns the GPU object for the current browsing context. The entry point for the WebGPU API.
  • hardwareConcurrency Read only
    • : Returns the number of logical processor cores available.
  • hid Read only Experimental
    • : Returns an HID object providing methods for connecting to HID devices, listing attached HID devices, and event handlers for connected HID devices.
  • ink Read only Experimental
    • : Returns an Ink object for the current document, providing access to Ink API functionality.
  • keyboard Read only Experimental
    • : Returns a Keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
  • language Read only
    • : Returns a string representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
  • languages Read only
    • : Returns an array of strings representing the languages known to the user, by order of preference.
  • locks Read only
    • : Returns a LockManager object that provides methods for requesting a new Lock object and querying for an existing Lock object.
  • login Read only
  • maxTouchPoints Read only
    • : Returns the maximum number of simultaneous touch contact points are supported by the current device.
  • mediaCapabilities Read only
    • : Returns a MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.
  • mediaDevices Read only
  • mediaSession Read only
    • : 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.
  • onLine Read only
    • : Returns a boolean value indicating whether the browser is working online.
  • pdfViewerEnabled Read only
    • : Returns true if the browser can display PDF files inline when navigating to them, and false otherwise.
  • permissions Read only
  • preferences Read only Experimental
  • presentation Read only
  • scheduling Read only Experimental
    • : Returns a Scheduling object for the current document.
  • serial Read only
    • : Returns a Serial object, which represents the entry point into the Web Serial API to enable the control of serial ports.
  • serviceWorker Read only
  • 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.
  • usb Read only
    • : Returns a USB object for the current document, providing access to WebUSB API functionality.
  • userActivation Read only
    • : Returns a UserActivation object containing information about the current window’s user activation state.
  • userAgent Read only
    • : Returns the user agent string for the current browser.
  • userAgentData Read only Experimental
    • : Returns a NavigatorUAData object, which gives access to information about the browser and operating system of the user.
  • virtualKeyboard Read only Experimental
    • : Returns a reference to the VirtualKeyboard API, to take control of the on-screen virtual keyboard.
  • wakeLock Read only
    • : Returns a WakeLock interface you can use to request screen wake locks and prevent screen from dimming, turning off, or showing a screen saver.
  • webdriver Read only
    • : Indicates whether the user agent is controlled by automation.
  • windowControlsOverlay Read only
    • : Returns the WindowControlsOverlay interface which exposes information about the geometry of the title bar in desktop Progressive Web Apps, and an event to know whenever it changes.
  • xr Read only Experimental

Non-standard properties

  • buildID Read only
    • : 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.
  • globalPrivacyControl Read only Experimental
    • : Returns a boolean indicating a user’s consent to their information being shared or sold.
  • standalone
    • : Returns a boolean indicating whether the browser is running in standalone mode. Available on Apple’s iOS Safari only.

Deprecated properties

  • activeVRDisplays Read only Deprecated
    • : Returns an array containing every VRDisplay object that is currently presenting (isPresenting is true).
  • appCodeName Read only
    • : Always returns 'Mozilla', in any browser.
  • appName Read only
    • : Always returns 'Netscape', in any browser.
  • appVersion Read only
    • : Returns the version of the browser as a string. Do not rely on this property to return the correct value.
  • doNotTrack Read only Deprecated
    • : 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.
  • mimeTypes Read only
    • : Returns a MimeTypeArray listing the MIME types supported by the browser.
  • oscpu Read only
    • : Returns a string that represents the current operating system.
  • platform Read only
    • : Returns a string representing the platform of the browser. Do not rely on this function to return a significant value.
  • plugins Read only
    • : Returns a PluginArray listing the plugins installed in the browser.
  • product Read only
    • : Always returns 'Gecko', in any browser.
  • productSub Read only
    • : Returns either the string '20030107', or '"20100101'.
  • vendor Read only
    • : Returns either the empty string, 'Apple Computer Inc.', or 'Google Inc.'.
  • vendorSub Read only
    • : Always returns the empty string.

Instance methods

Doesn’t inherit any method.

  • canShare()
    • : Returns true if a call to Navigator.share() would succeed.
  • clearAppBadge()
    • : Clears a badge on the current app’s icon and returns a Promise that resolves with undefined.
  • deprecatedReplaceInURN() Experimental
    • : Substitutes specified strings inside the mapped URL corresponding to a given opaque URN or FencedFrameConfig’s internal url 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 to privacy sandbox APIs.
  • getAutoplayPolicy() Experimental
    • : Returns a value indicating whether the specified media element, audio context, or media feature “type” is allowed to autoplay.
  • getBattery()
    • : Returns a promise that resolves with a BatteryManager object that returns information about the battery charging status.
  • getGamepads()
    • : returns an array of Gamepad objects, one for each gamepad connected to the device.
  • getInstalledRelatedApps() Experimental
    • : Returns a promise that resolves with an array of objects representing any related native or Progressive Web Applications that the user has installed.
  • registerProtocolHandler()
    • : Allows websites to register themselves as a possible handler for a given protocol.
  • requestMediaKeySystemAccess()
    • : Returns a Promise for a MediaKeySystemAccess object.
  • requestMIDIAccess()
    • : Returns a Promise representing a request for access to MIDI devices on the user’s system.
  • sendBeacon()
    • : Used to asynchronously transfer a small amount of data using HTTP from the User Agent to a web server.
  • setAppBadge()
    • : Sets a badge on the icon associated with this app and returns a Promise that resolves with undefined.
  • share()
    • : Invokes the native sharing mechanism of the current platform.
  • vibrate()
    • : Causes vibration on devices with support for it. Does nothing if vibration support isn’t available.
  • unregisterProtocolHandler()
    • : Unregister a website that is a handler for a given protocol.

Deprecated methods

  • getUserMedia() Deprecated
    • : After having prompted the user for permission, returns the audio or video stream associated to a camera or microphone on the local computer.
  • getVRDisplays() Deprecated
    • : Returns a promise that resolves to an array of VRDisplay objects representing any available VR devices connected to the computer.
  • javaEnabled()
    • : Always returns false.
  • taintEnabled()
    • : Returns false. JavaScript taint/untaint functions removed in JavaScript 1.2.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.