WorkerNavigator
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.
Note: This feature is only available inWeb Workers.
TheWorkerNavigator
interface represents a subset of theNavigator
interface allowed to be accessed from aWorker
. Such an object is initialized for each worker and is available via theself.navigator
property.
In this article
Instance properties
TheWorkerNavigator
interface doesn't inherit any property.
WorkerNavigator.appCodeName
DeprecatedRead onlyAlways returns
'Mozilla'
, in any browser. This property is kept only for compatibility purposes.WorkerNavigator.appName
DeprecatedRead onlyReturns the official name of the browser. Do not rely on this property to return the correct value.
WorkerNavigator.appVersion
DeprecatedRead onlyReturns the version of the browser as a string. Do not rely on this property to return the correct value.
WorkerNavigator.connection
Read onlyProvides a
NetworkInformation
object containing information about the network connection of a device.WorkerNavigator.deviceMemory
Read onlySecure contextReturns 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.
WorkerNavigator.globalPrivacyControl
Read onlyExperimentalReturns a boolean indicating a user's consent to their information being shared or sold.
WorkerNavigator.gpu
Read onlySecure contextReturns the
GPU
object for the current worker context. The entry point for theWebGPU API.WorkerNavigator.hardwareConcurrency
Read onlyReturns the number of logical processor cores available.
WorkerNavigator.hid
Read onlyExperimentalSecure contextReturns an
HID
object providing methods for connecting to HID devices already granted permission by the user and listing attached HID devices, and event handlers for responding to HID devices connecting and disconnecting.WorkerNavigator.language
Read onlyReturns 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.WorkerNavigator.languages
Read onlyReturns an array of strings representing the languages known to the user, by order of preference.
WorkerNavigator.locks
Read onlySecure contextReturns a
LockManager
object which provides methods for requesting a newLock
object and querying for an existingLock
object.WorkerNavigator.mediaCapabilities
Read onlyReturns a
MediaCapabilities
object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.WorkerNavigator.onLine
Read onlyReturns a boolean value indicating whether the browser is online.
WorkerNavigator.permissions
Read onlyReturns a
Permissions
object that can be used to query and update permission status of APIs covered by thePermissions API.WorkerNavigator.platform
DeprecatedRead onlyReturns a string representing the platform of the browser. Do not rely on this property to return the correct value.
WorkerNavigator.product
DeprecatedRead onlyAlways returns
'Gecko'
, on any browser. This property is kept only for compatibility purposes.WorkerNavigator.serial
Read onlyExperimentalSecure contextReturns a
Serial
object, which represents the entry point into theWeb Serial API, to enable the control of serial ports.WorkerNavigator.serviceWorker
Read onlySecure contextReturns a
ServiceWorkerContainer
object, which provides access to registration, removal, upgrade, and communication with theServiceWorker
objects for theassociated document.WorkerNavigator.storage
Read onlySecure contextReturns a
StorageManager
interface for managing persistence permissions and estimating available storage.WorkerNavigator.usb
Read onlySecure contextReturns a
USB
object for the current document, providing access toWebUSB API functionality.WorkerNavigator.userAgent
Read onlyReturns the user agent string for the current browser.
WorkerNavigator.userAgentData
Read onlyExperimentalSecure contextReturns a
NavigatorUAData
object, which gives access to information about the browser and operating system of the user.
Instance methods
TheWorkerNavigator
interface doesn't inherit any method.
WorkerNavigator.clearAppBadge()
Secure contextClears a badge on the current app's icon and returns a
Promise
that resolves withundefined
.WorkerNavigator.setAppBadge()
Secure contextSets a badge on the icon associated with this app and returns a
Promise
that resolves withundefined
.
Specifications
Specification |
---|
HTML> # the-workernavigator-object> |
Browser compatibility
Loading…
See also
- Other Worker-related interfaces:
Worker
,WorkerLocation
, andWorkerGlobalScope
- Using web workers