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 WorkerGlobalScope.navigator property obtained by calling window.self.navigator.
Properties
The WorkerNavigator interface implements properties from the NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorDataStore, and NavigatorConcurrentHardware interfaces.
WorkerNavigator.permissionsRead only- Returns a
Permissionsobject that can be used to query and update permission status of APIs covered by the Permissions API.
Inherited properties
NavigatorID.appCodeNameRead only- Always returns
'Mozilla', in any browser. This property is kept only for compatibility purposes. NavigatorID.appNameRead only- Returns the official name of the browser. Do not rely on this property to return the correct value.
NavigatorID.appVersionRead only- Returns the version of the browser as a string. Do not rely on this property to return the correct value.
NavigatorConcurrentHardware.hardwareConcurrencyRead only- Returns the number of logical processor cores available.
NavigatorLanguage.languageRead only- Returns a
DOMStringrepresenting the language version of the browser. Thenullvalue is returned when this is unknown. NavigatorLanguage.languagesRead only- Returns an array of
DOMStrings representing the languages known to the user, in order of preference. NavigatorOnLine.onLineRead only- Returns a
Booleanindicating whether the browser is online. NavigatorID.platformRead only- Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
NavigatorID.productRead only- Always returns
'Gecko', on any browser. This property is kept only for compatibility purposes. NavigatorID.userAgentRead only- Returns the user agent string for the current browser.
Methods
The WorkerNavigator interface implements methods from the NavigatorID, NavigatorLanguage and NavigatorOnLine interfaces.
WorkerNavigator.sendBeacon()- Used to asynchronously transfer small HTTP data from a
Workerto a web server.
Specifications
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard The definition of 'WorkerNavigator' in that specification. |
Living Standard | No change from Web Workers. |
| Web Workers The definition of 'WorkerNavigator' in that specification. |
Editor's Draft | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | ? | 3.5 (1.9.1) | ? | ? | ? |
appCodeName, product, taintEnabled() |
(Yes) | 28 (28) | (Yes) | (Yes) | (Yes) |
onLine |
? | 29 (29) | ? | ? | ? |
language, languages |
? | 35 (35) | ? | ? | ? |
permissions |
43.0 | 46 (46) | ? | ? | ? |
sendBeacon() |
No support | No support | No support | No support | No support |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|---|
| Basic support | ? | ? | 1.0 (1.9.1) | 1.0.1 | ? | ? | ? |
appCodeName, product, taintEnabled() |
(Yes) | (Yes) | 28.0 (28) | 1.3 | (Yes) | (Yes) | (Yes) |
onLine |
? | ? | 29.0 (29) | 1.4 | ? | ? | ? |
language, languages |
? | No support | 35.0 (35) | 2.2 | ? | ? | ? |
permissions |
? | 43.0 | 46.0 (46) | ? | ? | ? | ? |
sendBeacon() |
No support | No support | No support | No support | No support | No support | No support |
See also
- Other Worker-related interfaces:
Worker,WorkerLocation, andWorkerGlobalScope. - Using web workers.