WorkerNavigator Class

https://html.spec.whatwg.org/multipage/workers.html#the-workernavigator-object: the identity and the state of the user agent in a worker.

public sealed class WorkerNavigator

Properties

NameDescription
AppCodeNameGets the legacy application code name, always Mozilla.
AppNameGets the legacy application name, always Netscape.
AppVersionGets the legacy application version, derived from the user agent.
ConnectionGets the network connection of the device (https://wicg.github.io/netinfo/#navigatornetworkinformation-interface), read from NetworkInformationOptions.Provider.
DeviceMemoryGets the approximate memory of the device, in GiB (see Navigator.DeviceMemory).
GlobalPrivacyControlGets whether the user does not consent to the sale or sharing of their data (https://w3c.github.io/gpc/#dom-globalprivacycontrol-globalprivacycontrol): see GlobalPrivacyControlOptions.
HardwareConcurrencyGets the number of logical processors available to the user agent.
LanguageGets the preferred language of the user.
LanguagesGets the languages preferred by the user, by order of preference.
LocksGets the lock manager of the worker (https://w3c.github.io/web-locks/#dom-navigatorlocks-locks).
OnLineGets a value indicating whether the user agent is online.
PermissionsGets the Permissions API of the worker (https://w3c.github.io/permissions/#dom-workernavigator-permissions).
PlatformGets the platform of the user agent, an empty string.
ProductGets the legacy product name, always Gecko.
ProductSubGets the legacy product sub-version.
ServiceWorkerGets the service workers of the worker (https://w3c.github.io/ServiceWorker/#navigator-service-worker).
StorageGets the storage manager of the worker (https://storage.spec.whatwg.org/#dom-navigatorstorage-storage).
UserAgentGets the user agent string.
UserAgentDataGets the identity of the user agent given by the User-Agent Client Hints (https://wicg.github.io/ua-client-hints/#dom-navigatorua-useragentdata): the values of BrowsingContextOptions.ClientHints. The scripts only see it in a secure context.
VendorGets the vendor of the user agent, an empty string.
VendorSubGets the legacy vendor sub-version, an empty string.

AppCodeName

Worker.cs

Gets the legacy application code name, always Mozilla.

public string AppCodeName { get; }

AppName

Worker.cs

Gets the legacy application name, always Netscape.

public string AppName { get; }

AppVersion

Worker.cs

Gets the legacy application version, derived from the user agent.

public string AppVersion { get; }

Gets the network connection of the device (https://wicg.github.io/netinfo/#navigatornetworkinformation-interface), read from NetworkInformationOptions.Provider.

public NetworkInformation Connection { get; }

Gets the approximate memory of the device, in GiB (see Navigator.DeviceMemory).

public double DeviceMemory { get; }

Property value

double

GlobalPrivacyControl

NetworkInformation.cs

Gets whether the user does not consent to the sale or sharing of their data (https://w3c.github.io/gpc/#dom-globalprivacycontrol-globalprivacycontrol): see GlobalPrivacyControlOptions.

public bool GlobalPrivacyControl { get; }

HardwareConcurrency

Worker.cs

Gets the number of logical processors available to the user agent.

public ulong HardwareConcurrency { get; }

Language

Worker.cs

Gets the preferred language of the user.

public string Language { get; }

Languages

Worker.cs

Gets the languages preferred by the user, by order of preference.

public IReadOnlyList<string> Languages { get; }

Gets the lock manager of the worker (https://w3c.github.io/web-locks/#dom-navigatorlocks-locks).

public LockManager Locks { get; }

OnLine

Worker.cs

Gets a value indicating whether the user agent is online.

public bool OnLine { get; }

Permissions

Worker.cs

Gets the Permissions API of the worker (https://w3c.github.io/permissions/#dom-workernavigator-permissions).

public Permissions Permissions { get; }

Platform

Worker.cs

Gets the platform of the user agent, an empty string.

public string Platform { get; }

Product

Worker.cs

Gets the legacy product name, always Gecko.

public string Product { get; }

ProductSub

Worker.cs

Gets the legacy product sub-version.

public string ProductSub { get; }

ServiceWorker

Worker.cs

Gets the service workers of the worker (https://w3c.github.io/ServiceWorker/#navigator-service-worker).

public ServiceWorkerContainer ServiceWorker { get; }

Storage

Worker.cs

Gets the storage manager of the worker (https://storage.spec.whatwg.org/#dom-navigatorstorage-storage).

public StorageManager Storage { get; }

UserAgent

Worker.cs

Gets the user agent string.

public string UserAgent { get; }

Gets the identity of the user agent given by the User-Agent Client Hints (https://wicg.github.io/ua-client-hints/#dom-navigatorua-useragentdata): the values of BrowsingContextOptions.ClientHints. The scripts only see it in a secure context.

public NavigatorUAData UserAgentData { get; }

Vendor

Worker.cs

Gets the vendor of the user agent, an empty string.

public string Vendor { get; }

VendorSub

Worker.cs

Gets the legacy vendor sub-version, an empty string.

public string VendorSub { get; }

Methods

NameDescription
ClearAppBadge()Clears the badge of the application (https://w3c.github.io/badging/#clearappbadge-method), as setAppBadge(0).
SetAppBadge(ulong?)Sets the badge of the application (https://w3c.github.io/badging/#setappbadge-method), with BadgingOptions.SetBadge.

ClearAppBadge()

Badging.cs

Clears the badge of the application (https://w3c.github.io/badging/#clearappbadge-method), as setAppBadge(0).

public Task ClearAppBadge()

SetAppBadge(ulong?)

Badging.cs

Sets the badge of the application (https://w3c.github.io/badging/#setappbadge-method), with BadgingOptions.SetBadge.

public Task SetAppBadge(ulong? contents = null)

Parameters

contents ulong?
The number to show, or null to show a flag.

Returns

Task

See also