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.

Properties

The WorkerNavigator interface doesn't inherit any property.

WorkerNavigator.appCodeName Read only

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

WorkerNavigator.appName Read only

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

WorkerNavigator.appVersion 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 NetworkInformation object containing information about the network connection of a device.

WorkerNavigator.hardwareConcurrencyRead only

Returns the number of logical processor cores available.

WorkerNavigator.language Read only

Returns a DOMString 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 DOMString 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.onLineRead 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 Read only

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

WorkerNavigator.product Read only

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

WorkerNavigator.serial Read only

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

WorkerNavigator.storageRead only

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

WorkerNavigator.userAgentRead only

Returns the user agent string for the current browser.

WorkerNavigator.userAgentData Read only

Returns a NavigatorUAData object, which gives access to information about the browser and operating system of the user.

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
Yes
4
Yes
Yes
4
Yes
5
Yes
appCodeName
4
12
3.5
10
Yes
10
Yes
18
4
Yes
10
Yes
appName
4
12
3.5
10
Yes
4
Yes
18
4
Yes
5
Yes
appVersion
4
12
3.5
10
Yes
4
Yes
18
4
Yes
5
Yes
connection
61
79
No
No
Yes
No
50
38
53
37
No
3.0
deviceMemory
65
79
No
No
52
No
65
65
No
47
No
9.0
hardwareConcurrency
37
15
48
No
24
10.1-11
37
37
48
24
10.3-11
3.0
language
4
12
3.5
Before 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.
11
Closest available (non-standard) properties are userLanguage and browserLanguage.
4
10
Yes
18
4
10.1
10
Yes
languages
37
Before Chrome 65, navigator.languages[0] is not guaranteed to equal navigator.language.
16
32
In Firefox, the navigator.languages property's value is taken from the intl.accept_languages preference.
No
Closest available (non-standard) properties are userLanguage and browserLanguage.
24
10.1
37
Before version 65, navigator.languages[0] is not guaranteed to equal navigator.language.
37
Before Chrome 65, navigator.languages[0] is not guaranteed to equal navigator.language.
32
In Firefox, the navigator.languages property's value is taken from the intl.accept_languages preference.
24
10.3
3.0
locks
69
79
No
No
56
No
69
69
No
48
No
10.0
mediaCapabilities
76
79
63
No
63
No
76
76
63
54
No
12.0
onLine
4
12
3.5
Since 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.6
From 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
≤37
Faulty in a WebView component, see Issue bug 16760.
18
4
11
From 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
No
No
43
No
30
No
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
Yes
4
Yes
18
4
Yes
5
Yes
product
4
12
3.5
11
15
10
Yes
18
4
14
10
Yes
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
No
55
55
57
42
No
6.0
usb
70
79
No
No
57
No
70
70
No
49
No
10.0
userAgent
4
12
3.5
10
Yes
4
Yes
18
4
Yes
5
Yes
userAgentData
90
90
No
No
76
No
No
90
No
No
No
No

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator