Navigator extension type
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 window.navigator
property.
API documentation sourced from MDN Web Docs.
- on
- Implemented types
- Available extensions
Properties
- appCodeName → String
-
The value of the
Navigator.appCodeName
property is always "Mozilla
", in any browser. This property is kept only for compatibility purposes.no setter - appName → String
-
The value of the
Navigator.appName
property is always "Netscape
", in any browser. This property is kept only for compatibility purposes.no setter - appVersion → String
-
Returns either "
4.0
" or a string representing version information about the browser.no setter - clipboard → Clipboard
-
The
clipboard
read-only property of the Navigator interface returns a Clipboard object used to read and write the clipboard's contents.no setter - connection → NetworkInformation
-
The
connection
read-only property of the Navigator interface returns a NetworkInformation object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered.no setter -
navigator.cookieEnabled
returns a Boolean value that indicates whether cookies are enabled or not.no setter - credentials → CredentialsContainer
-
The
credentials
read-only property of the Navigator interface returns the CredentialsContainer object associated with the current document, which exposes methods to request credentials. The CredentialsContainer interface also notifies the user agent when an interesting event occurs, such as a successful sign-in or sign-out. This interface can be used for feature detection.no setter - deviceMemory → double
-
The
deviceMemory
read-only property of the Navigator interface returns the approximate amount of device memory in gigabytes.no setter - geolocation → Geolocation
-
The
Navigator.geolocation
read-only property returns a Geolocation object that gives Web content access to the location of the device. This allows a website or app to offer customized results based on the user's location.no setter - hardwareConcurrency → int
-
The
navigator.hardwareConcurrency
read-only property returns the number of logical processors available to run threads on the user's computer.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isDefinedAndNotNull → bool
-
Available on JSAny?, provided by the NullableUndefineableJSAnyExtension extension
no setter - isNull → bool
-
Available on JSAny?, provided by the NullableUndefineableJSAnyExtension extension
Whether this value corresponds to JavaScriptnull
.no setter - isTruthy → JSBoolean
-
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of!!
in JavaScript.this
no setter - isUndefined → bool
-
Available on JSAny?, provided by the NullableUndefineableJSAnyExtension extension
Whether this value corresponds to JavaScriptundefined
.no setter - isUndefinedOrNull → bool
-
Available on JSAny?, provided by the NullableUndefineableJSAnyExtension extension
no setter - language → String
-
The
Navigator.language
read-only property returns a string representing the preferred language of the user, usually the language of the browser UI.no setter -
languages
→ JSArray<
JSString> -
The
Navigator.languages
read-only property returns an array of strings representing the user's preferred languages. The language is described using language tags according to5646, "Tags for Identifying Languages (also known as BCP 47)"
. In the returned array they are ordered by preference with the most preferred language first.no setter - locks → LockManager
-
The
locks
read-only property of the Navigator interface returns a LockManager object which provides methods for requesting a new Lock object and querying for an existingLock
object.no setter - maxTouchPoints → int
-
The
maxTouchPoints
read-only property of the Navigator interface returns the maximum number of simultaneous touch contact points are supported by the current device.no setter - mediaCapabilities → MediaCapabilities
-
The
Navigator.mediaCapabilities
read-only property returns a MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities as defined by the Media Capabilities API.no setter - mediaDevices → MediaDevices
-
The
mediaDevices
read-only property of the Navigator interface returns a MediaDevices object, which provides access to connected media input devices like cameras and microphones, as well as screen sharing.no setter - mediaSession → MediaSession
-
The
mediaSession
read-only property of the Navigator interface returns a MediaSession object that can be used to share with the browser metadata and other information about the current playback state of media being handled by a document.no setter - mimeTypes → MimeTypeArray
-
Returns a MimeTypeArray object, which contains a list of MimeType
objects representing the MIME types recognized and supported by the
browser.
The array can be queried for information about the enabled plugin that is
used to handle a file of the specified type.
Named properties of the returned object are not enumerable (except in very
old browser versions).
no setter
- not → JSBoolean
-
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of!
in JavaScript.this
no setter - onLine → bool
-
Returns the online status of the browser. The property returns a boolean
value, with
true
meaning online andfalse
meaning offline. The property sends updates whenever the browser's ability to connect to the network changes. The update occurs when the user follows links or when a script requests a remote page. For example, the property should returnfalse
when users click links soon after they lose internet connection.no setter - oscpu → String
-
The
Navigator.oscpu
property returns a string that identifies the current operating system.no setter - pdfViewerEnabled → bool
-
The
pdfViewerEnabled
read-only property of the Navigator interface indicates whether the browser supports inline display of PDF files when navigating to them.no setter - permissions → Permissions
-
The
permissions
read-only property of the Navigator interface returns a Permissions object that can be used to query and update permission status of APIs covered by the Permissions API.no setter - platform → String
-
The
platform
property read-only property of the Navigator interface returns a string identifying the platform on which the user's browser is running.no setter - plugins → PluginArray
-
Returns a PluginArray object, listing the Plugin objects describing
the plugins installed in the application.
Named properties of the returned object are not enumerable (except in very
old browser versions).
no setter
- presentation → JSObject
-
The
presentation
read-only property of Navigator serves as the entry point for the Presentation API and returns a reference to Presentation object.no setter - product → String
-
The value of the
Navigator.product
property is always "Gecko
", in any browser. This property is kept only for compatibility purposes.no setter - productSub → String
-
The
Navigator.productSub
read-only property that returns either the string "20030107", or the string "20100101".no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serviceWorker → ServiceWorkerContainer
-
The
serviceWorker
read-only property of the Navigator interface returns the ServiceWorkerContainer object for the associated document, which provides access to registration, removal, upgrade, and communication with the ServiceWorker.no setter - storage → StorageManager
-
The
Navigator.storage
read-only property returns the singleton StorageManager object used to access the overall storage capabilities of the browser for the current site or app. The returned object lets you examine and configure persistence of data stores and learn approximately how much more space your browser has available for local storage use.no setter - usb → JSObject
-
The
usb
read-only property of the Navigator interface returns aUSB
object for the current document, providing access to WebUSB API functionality.no setter - userActivation → UserActivation
-
The read-only
userActivation
property of the Navigator interface returns a UserActivation object which contains information about the current window's user activation state.no setter - userAgent → String
-
The
Navigator.userAgent
read-only property returns the user agent string for the current browser.no setter - vendor → String
-
The value of the Navigator
vendor
property is always either "Google Inc.
", "Apple Computer, Inc.
", or (in Firefox) the empty string.no setter - vendorSub → String
-
The value of the
Navigator.vendorSub
property is always the empty string, in any browser.no setter - wakeLock → WakeLock
-
The
wakeLock
read-only property of the Navigator interface returns a WakeLock interface that allows a document to acquire a screen wake lock. While a screen wake lock is active, the user agent will try to prevent the device from dimming the screen, turning it off completely, or showing a screensaver.no setter - webdriver → bool
-
The
webdriver
read-only property of thenavigator
interface indicates whether the user agent is controlled by automation.no setter - windowControlsOverlay → JSObject
-
The
windowControlsOverlay
read-only property of the Navigator interface returns theWindowControlsOverlay
interface, which exposes information about the title bar geometry in desktop Progressive Web Apps that use the Window Controls Overlay API.no setter
Methods
-
add(
JSAny? any) → JSAny -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
+any
-
and(
JSAny? any) → JSAny? -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
&&any
-
callMethod<
R extends JSAny?> (JSAny method, [JSAny? arg1, JSAny? arg2, JSAny? arg3, JSAny? arg4]) → R -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Callsmethod
on this JSObject with up to four arguments. -
callMethodVarArgs<
R extends JSAny?> (JSAny method, [List< JSAny?> ? arguments]) → R -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Callsmethod
on this JSObject with a variable number ofarguments
. -
The
canShare()
method of the Navigator interface returnstrue
if the equivalent call tonavigator.share
would succeed. -
clearAppBadge(
) → JSPromise< JSAny?> -
The
clearAppBadge()
method of the Navigator interface clears a badge on the current app's icon by setting it tonothing
. The valuenothing
indicates that no badge is currently set, and the status of the badge is cleared. -
dartify(
) → Object? -
Available on JSAny?, provided by the JSAnyUtilityExtension extension
Converts a JavaScript value to the Dart equivalent if possible. -
delete(
JSAny property) → JSBoolean -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Deletes the property with keyproperty
from this JSObject. -
divide(
JSAny? any) → JSAny -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
/any
-
equals(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
==any
-
exponentiate(
JSAny? any) → JSAny -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
**any
-
getBattery(
) → JSPromise< BatteryManager> -
The
getBattery()
method provides information about the system's battery. It returns a battery promise, which resolves with a BatteryManager object providing some properties to get the battery status also some events you can handle to monitor the battery status. This implements theBattery Status API
; see that documentation for additional details, a guide to using the API, and sample code. -
getGamepads(
) → JSArray< Gamepad?> -
The
Navigator.getGamepads()
method returns an array of Gamepad objects, one for each gamepad connected to the device. -
getProperty<
R extends JSAny?> (JSAny property) → R -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
The value of the property keyproperty
of this JSObject. -
greaterThan(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
>any
-
greaterThanOrEqualTo(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
>=any
-
has(
String property) → bool -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Shorthand helper for hasProperty to check whether this JSObject contains the property keyproperty
, but takes and returns a Dart value. -
hasProperty(
JSAny property) → JSBoolean -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Whether or not this JSObject contains the property keyproperty
. -
instanceof(
JSFunction constructor) → bool -
Available on JSAny?, provided by the JSAnyUtilityExtension extension
Whether thisJSAny?
is aninstanceof
constructor
. -
instanceOfString(
String constructorName) → bool -
Available on JSAny?, provided by the JSAnyUtilityExtension extension
Whether thisJSAny?
is aninstanceof
the constructor that is defined byconstructorName
, which is looked up in the globalContext. -
isA<
T extends JSAny?> () → bool -
Available on JSAny?, provided by the JSAnyUtilityExtension extension
Whether thisJSAny?
is an instance of the JavaScript type that is declared byT
. -
javaEnabled(
) → bool - This method always returns false.
-
lessThan(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
<any
-
lessThanOrEqualTo(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
<=any
-
modulo(
JSAny? any) → JSAny -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
%any
-
multiply(
JSAny? any) → JSAny -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
*any
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notEquals(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
!=any
-
or(
JSAny? any) → JSAny? -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
||any
-
registerProtocolHandler(
String scheme, String url) → void -
The Navigator method
registerProtocolHandler()
lets websites register their ability to open or handle particular URL schemes (aka protocols). -
requestMediaKeySystemAccess(
String keySystem, JSArray< MediaKeySystemConfiguration> supportedConfigurations) → JSPromise<MediaKeySystemAccess> -
The
requestMediaKeySystemAccess()
method of the Navigator interface returns aPromise
which delivers a MediaKeySystemAccess object that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream. -
requestMIDIAccess(
[MIDIOptions options]) → JSPromise< MIDIAccess> -
The
requestMIDIAccess()
method of the Navigator interface returns aPromise
representing a request for access to MIDI devices on a user's system. This method is part of the Web MIDI API, which provides a means for accessing, enumerating, and manipulating MIDI devices. -
sendBeacon(
String url, [BodyInit? data]) → bool -
The
navigator.sendBeacon()
method sends an HTTP POST request containing a small amount of data to a web server. -
setAppBadge(
[int contents]) → JSPromise< JSAny?> -
The
setAppBadge()
method of the Navigator interface sets a badge on the icon associated with this app. If a value is passed to the method, this will be set as the value of the badge. Otherwise the badge will display as a dot, or other indicator as defined by the platform. -
setProperty(
JSAny property, JSAny? value) → void -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Write thevalue
of property keyproperty
of this JSObject. -
The
share()
method of the Navigator interface invokes the native sharing mechanism of the device to share data such as text, URLs, or files. The available share targets depend on the device, but might include the clipboard, contacts and email applications, websites, Bluetooth, etc. -
strictEquals(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
===any
-
strictNotEquals(
JSAny? any) → JSBoolean -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
!==any
-
subtract(
JSAny? any) → JSAny -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
-any
-
taintEnabled(
) → bool -
The
Navigator.taintEnabled()
method always returnsfalse
. -
toString(
) → String -
A string representation of this object.
inherited
-
typeofEquals(
String typeString) → bool -
Available on JSAny?, provided by the JSAnyUtilityExtension extension
Whether the result oftypeof
on thisJSAny?
istypeString
. -
unregisterProtocolHandler(
String scheme, String url) → void -
The Navigator method
unregisterProtocolHandler()
removes a protocol handler for a given URL scheme. -
unsignedRightShift(
JSAny? any) → JSNumber -
Available on JSAny?, provided by the JSAnyOperatorExtension extension
The result of
in JavaScript.this
>>>any
-
vibrate(
VibratePattern pattern) → bool -
The
vibrate()
method of the Navigator interface pulses the vibration hardware on the device, if such hardware exists. If the device doesn't support vibration, this method has no effect. If a vibration pattern is already in progress when this method is called, the previous pattern is halted and the new one begins instead.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String property) → JSAny? -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Shorthand helper for getProperty to get the value of the property keyproperty
of this JSObject, but takes and returns a Dart value. -
operator []=(
String property, JSAny? value) → void -
Available on JSObject, provided by the JSObjectUnsafeUtilExtension extension
Shorthand helper for setProperty to write thevalue
of the property keyproperty
of this JSObject, but takes a Dart value.