W3cubDocs

/Web APIs

WorkerNavigator

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.

Instance properties

The WorkerNavigator interface doesn't inherit any property.

WorkerNavigator.appCodeName Deprecated Read only

Always returns 'Mozilla', in any browser. This property is kept only for compatibility purposes.

WorkerNavigator.appName Deprecated Read only

Returns the official name of the browser. Do not rely on this property to return the correct value.

WorkerNavigator.appVersion Deprecated Read only

Returns the version of the browser as a string. Do not rely on this property to return the correct value.

WorkerNavigator.connection Read only

Provides a NetworkInformation object containing information about the network connection of a device.

WorkerNavigator.globalPrivacyControl Read only Experimental

Returns a boolean indicating a user's consent to their information being shared or sold.

WorkerNavigator.gpu Read only Experimental

Returns the GPU object for the current worker context. The entry point for the WebGPU API.

WorkerNavigator.hardwareConcurrency Read only

Returns the number of logical processor cores available.

WorkerNavigator.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.

WorkerNavigator.languages Read only

Returns an array of strings representing the languages known to the user, by order of preference.

WorkerNavigator.locks Read only

Returns a LockManager object which provides methods for requesting a new Lock object and querying for an existing Lock object.

WorkerNavigator.mediaCapabilities Read only

Returns a MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.

WorkerNavigator.onLine Read only

Returns a boolean value indicating whether the browser is online.

WorkerNavigator.permissions Read only

Returns a Permissions object that can be used to query and update permission status of APIs covered by the Permissions API.

WorkerNavigator.platform Deprecated Read only

Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.

WorkerNavigator.product Deprecated Read only

Always returns 'Gecko', on any browser. This property is kept only for compatibility purposes.

WorkerNavigator.serial Read only Experimental

Returns a Serial object, which represents the entry point into the Web Serial API to enable the control of serial ports.

WorkerNavigator.storage Read only

Returns a StorageManager interface for managing persistence permissions and estimating available storage.

WorkerNavigator.userAgent Read only

Returns the user agent string for the current browser.

WorkerNavigator.userAgentData Read only Experimental

Returns a NavigatorUAData object, 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

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 preference privacy.globalprivacycontrol.enabled to true.
No No No No No
NoOpt-in to GPC by setting the preference privacy.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 by navigator.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 are userLanguage 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, the navigator.languages property's value is taken from the intl.accept_languages preference.
NoClosest available (non-standard) properties are userLanguage 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, the navigator.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 returns true 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 returns true 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 returns true 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
NoWebView exposes navigator.usb, but does not support WebUSB. See Chromium bug 933055.
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

© 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