The Navigator
object represents the state and identity of the user agent, allowing scripts to query and register themselves for certain activities. You can obtain a reference to the instantiated navigator
object using the read-only window.navigator
property.
navigator.connection
: Read-only. Provides aNetwork Information
object containing information about the device's network connection.navigator.cookieEnabled
: Read-only. Returnstrue
if cookies are enabled,false
otherwise.navigator.credentials
: Read-only. Returns theCredentials Container
interface, which exposes methods for requesting credentials and notifies the user agent of specific events, such as successful logins or sign-ins.navigator.geolocation
: Read-only. Returns a geographic location object that allows access to the device's location.navigator.hardwareConcurrency
: Read-only. Returns the number of available logical processor cores, accessible by directly callingnavigator.hardwareConcurrency
.navigator.language
: Read-only. Returns aDOMString
representing the user's preferred language (usually the language of the browser's UI), ornull
if unknown.navigator.maxTouchPoints
: Read-only. Returns the maximum number of simultaneous touch points supported by the current device.navigator.mediaDevices
: Read-only. Returns a reference to theMediaDevices
object, which can be used to obtain information about available media devices.navigator.mimeTypes
: Read-only. Returns aMimeTypeArray
object containing a list ofMimeType
objects representing theMIME
types recognized by the browser.navigator.onLine
: Read-only. Returns a boolean value indicating whether the browser is currently working online.navigator.plugins
: Read-only. Returns aPluginArray
object listing the plugin objects describing the installed plugins in the application.navigator.serviceWorker
: Read-only. Returns aServiceWorkerContainer
object, which provides access to registration, removal, upgrading, and communication withServiceWorker
objects relevant to the associated documents.navigator.storage
: Read-only. Returns a singletonStorageManager
object used to access the browser's overall storage capabilities for the current site or application. The returned object allows you to inspect and configure the persistence of data storage and get a rough idea of how much space the browser has available for local storage. Must be used within anHTTPS Secure context
.navigator.userAgent
: Read-only. Returns the user agent string for the current browser.navigator.vendor
: Read-only. Returns the vendor name of the current browser.
navigator.javaEnabled()
: This method returns a boolean value indicating whether the user's browser hasjava
enabled.navigator.registerProtocolHandler(scheme, url)
: This method allows websites to register their ability to open or handle specificURL
schemes (also known as protocols).navigator.requestMediaKeySystemAccess(keySystem, supportedConfigurations)
: This method returns aPromise
that resolves to aMediaKeySystemAccess
object, which can be used to access a specific media key system for creating keys to decrypt media streams. This method is part of the Encrypted Media ExtensionsAPI
, providing support for encrypted media andDRM
-protected videos on theWEB
, and it needs to be used in aHTTPS Secure context
environment.navigator.sendBeacon(url, data)
: This method asynchronously sends a small amount of data to a web server overHTTP
, typically used in conjunction with thevisibilitychange
event (but not with theunload
andbeforeunload
events).navigator.share(data)
: This method invokes the device's native sharing mechanism and needs to be used in aHTTPS Secure context
environment.navigator.vibrate(pattern)
: This method triggers the vibration hardware on the device, if available. If the device does not support vibration, this method has no effect. If this method is called when the device is already in a vibration mode, the previous mode will be paused and the new mode will start.
https://github.com/WindrunnerMax/EveryDay
https://developer.mozilla.org/zh-CN/docs/Web/API/navigator