The WorkerNavigator interface represents a subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the self.navigator property.
On this page
WorkerNavigator
Instance properties
The WorkerNavigator interface doesn't inherit any property.
WorkerNavigator.appCodeNameDeprecated Read only-
Always returns
'Mozilla', in any browser. This property is kept only for compatibility purposes. WorkerNavigator.appNameDeprecated Read only-
Returns the official name of the browser. Do not rely on this property to return the correct value.
WorkerNavigator.appVersionDeprecated Read only-
Returns the version of the browser as a string. Do not rely on this property to return the correct value.
WorkerNavigator.connectionRead only-
Provides a
NetworkInformationobject containing information about the network connection of a device. WorkerNavigator.globalPrivacyControlRead only Experimental-
Returns a boolean indicating a user's consent to their information being shared or sold.
WorkerNavigator.gpuRead only Experimental-
Returns the
GPUobject for the current worker context. The entry point for the WebGPU API. WorkerNavigator.hardwareConcurrencyRead only-
Returns the number of logical processor cores available.
WorkerNavigator.languageRead only-
Returns a string representing the preferred language of the user, usually the language of the browser UI. The
nullvalue is returned when this is unknown. WorkerNavigator.languagesRead only-
Returns an array of strings representing the languages known to the user, by order of preference.
WorkerNavigator.locksRead only-
Returns a
LockManagerobject which provides methods for requesting a newLockobject and querying for an existingLockobject. WorkerNavigator.mediaCapabilitiesRead only-
Returns a
MediaCapabilitiesobject that can expose information about the decoding and encoding capabilities for a given format and output capabilities. WorkerNavigator.onLineRead only-
Returns a boolean value indicating whether the browser is online.
WorkerNavigator.permissionsRead only-
Returns a
Permissionsobject that can be used to query and update permission status of APIs covered by the Permissions API. WorkerNavigator.platformDeprecated Read only-
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
WorkerNavigator.productDeprecated Read only-
Always returns
'Gecko', on any browser. This property is kept only for compatibility purposes. WorkerNavigator.serialRead only Experimental-
Returns a
Serialobject, which represents the entry point into theWeb Serial APIto enable the control of serial ports. WorkerNavigator.storageRead only-
Returns a
StorageManagerinterface for managing persistence permissions and estimating available storage. WorkerNavigator.userAgentRead only-
Returns the user agent string for the current browser.
WorkerNavigator.userAgentDataRead only Experimental-
Returns a
NavigatorUADataobject, which gives access to information about the browser and operating system of the user.
Instance methods
The WorkerNavigator interface neither inherits nor implements any method.
Specifications
| Specification |
|---|
| HTML Standard # the-workernavigator-object |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
WorkerNavigator |
4 | 12 | 3.5 | 10 | ≤12.1 | 4 | 4.4 | 18 | 4 | ≤12.1 | 5 | 1.0 |
appCodeName |
4 | 12 | 3.5 | 10 | 15 | 10 | 4.4 | 18 | 4 | 14 | 10 | 1.0 |
appName |
4 | 12 | 3.5 | 10 | ≤12.1 | 4 | 4.4 | 18 | 4 | ≤12.1 | 5 | 1.0 |
appVersion |
4 | 12 | 3.5 | 10 | ≤12.1 | 4 | 4.4 | 18 | 4 | ≤12.1 | 5 | 1.0 |
connection |
61 | 79 | No | No | 48 | No | 50 | 38 | 53–99 | 37 | No | 3.0 |
deviceMemory |
65 | 79 | No | No | 52 | No | 65 | 65 | No | 47 | No | 9.0 |
globalPrivacyControl |
No | No |
previewOpt-in to GPC by setting the preferenceprivacy.globalprivacycontrol.enabled to true.
|
No | No | No | No | No |
NoOpt-in to GPC by setting the preferenceprivacy.globalprivacycontrol.enabled to true.
|
No | No | No |
gpu |
113Currently supported on ChromeOS, macOS, and Windows only. |
113Currently supported on ChromeOS, macOS, and Windows only. |
No | No |
99Currently supported on ChromeOS, macOS, and Windows only. |
No | No | No | No | No | No | No |
hardwareConcurrency |
37 | 15 | 48 | No | 24 | 10.1–11 | 37 | 37 | 48 | 24 | 10.3–11 | 3.0 |
language |
4 | 12 |
3.5Before Firefox 4, this property's value was also part of the user agent string, as reported bynavigator.userAgent. Starting in Firefox 5, this property's value is based on the value of the Accept-Language HTTP header.
|
11Closest available (non-standard) properties areuserLanguage and browserLanguage.
|
4 | 10 | 4.4 | 18 | 4 | 10.1 | 10 | 1.0 |
languages |
37Before Chrome 65,navigator.languages[0] is not guaranteed to equal navigator.language.
|
16 |
32In Firefox, thenavigator.languages property's value is taken from the intl.accept_languages preference.
|
NoClosest available (non-standard) properties areuserLanguage and browserLanguage.
|
24 | 10.1 |
37Before version 65,navigator.languages[0] is not guaranteed to equal navigator.language.
|
37Before Chrome 65,navigator.languages[0] is not guaranteed to equal navigator.language.
|
32In Firefox, thenavigator.languages property's value is taken from the intl.accept_languages preference.
|
24 | 10.3 | 3.0 |
locks |
69 | 79 | 96 | No | 56 | 15.4 | 69 | 69 | 96 | 48 | 15.4 | 10.0 |
mediaCapabilities |
76 | 79 | 63 | No | 63 | 15.4 | 76 | 76 | 63 | 54 | 15.4 | 12.0 |
onLine |
4 | 12 |
3.5Since Firefox 4 the browser returnstrue when 'Work Offline' mode is disabled and false when it is enabled, regardless of actual connectivity. Since Firefox 41, on OS X and Windows, the returned values follow the actual network connectivity, unless 'Work offline' mode is selected (where it will always return false).
|
10 |
10.6From Opera 11.1 until Opera 12.1, the browser returnstrue when 'Work Offline' mode is disabled and false when it is enabled, regardless of actual connectivity.
|
4 |
4.4Can incorrectly return true, see bug 811122. |
18 | 4 |
11From Opera 11.1 until Opera 12.1, the browser returnstrue when 'Work Offline' mode is disabled and false when it is enabled, regardless of actual connectivity.
|
5 | 1.0 |
permissions |
43 | 79 | No | No | 30 | 16.4 | No | 43 | No | 30 | 16.4 | 4.0 |
platform |
4 | 12 |
3.5["Before Firefox 69,platform would report running on a 32-bit CPU if running the 32-bit version of Firefox on a 64-bit system.", "You can override the value returned by platform by setting the preference general.platform.override to the string you wish to be returned instead."]
|
10 | ≤12.1 | 4 | 4.4 | 18 | 4 | ≤12.1 | 5 | 1.0 |
product |
4 | 12 | 3.5 | 11 | 15 | 10 | 4.4 | 18 | 4 | 14 | 10 | 1.0 |
serial |
89 | 89 | No | No | No | No | No | No | No | No | No | No |
serviceWorker |
No | No | No | No | No | 11.1 | No | No | No | No | 11.3 | No |
storage |
55 | 79 | 57 | No | 42 | 15.2 | 55 | 55 | 57 | 42 | 15.2 | 6.0 |
usb |
70 | 79 | No | No | 57 | No | 70 | No | 49 | No | 10.0 | |
userAgent |
4 | 12 | 3.5 | 10 | ≤12.1 | 4 | 4.4 | 18 | 4 | ≤12.1 | 5 | 1.0 |
userAgentData |
90 | 90 | No | No | 76 | No | No | 90 | No | No | No | 15.0 |
See also
- Other Worker-related interfaces:
Worker,WorkerLocation, andWorkerGlobalScope - Using web workers
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator