Skip to content

WorkerNavigator

How Elide supports the navigator global: a WorkerNavigator whose userAgent, platform, language and other values are fixed at startup.

On this page

globalThis.navigator is a WorkerNavigator; its values are fixed at startup, and the constructor throws if called.

AttributeValue
appCodeName"Mozilla"
appName"Netscape"
product"Gecko"
appVersionElide version and platform.
userAgentElide user-agent string.
platformlinux, darwin, win32, another known host label, or unknown.
languageRuntime locale, normally a BCP-47 tag.
languagesFrozen one-element array containing language.
onLineAlways true.
hardwareConcurrencyAvailable processor count, at least 1.

Example

js
// navigator.mjs
console.log(navigator instanceof WorkerNavigator, navigator.onLine);
console.log(navigator.hardwareConcurrency >= 1, navigator.userAgent.includes(" Elide/"));
console.log(navigator.languages.length, Object.isFrozen(navigator.languages));
utf-8 · js · Lines: 4

elide run navigator.mjs prints:

text
true true
true true
1 true
utf-8 · text · Lines: 3

Reference

Status: Full · Not measured

Exports

ExportKindStatusNotes
WorkerNavigatorclassFullappCodeName, appName, appVersion, platform, product, userAgent, language, languages, onLine, hardwareConcurrency

Was this page helpful?