Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. WorkerNavigator

WorkerNavigator

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

* Some parts of this feature may have varying levels of support.

Note: This feature is only available inWeb Workers.

TheWorkerNavigator interface represents a subset of theNavigator interface allowed to be accessed from aWorker. Such an object is initialized for each worker and is available via theself.navigator property.

Instance properties

TheWorkerNavigator interface doesn't inherit any property.

WorkerNavigator.appCodeNameDeprecatedRead only

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

WorkerNavigator.appNameDeprecatedRead only

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

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

WorkerNavigator.deviceMemoryRead onlySecure context

Returns the amount of device memory in gigabytes. This value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024.

WorkerNavigator.globalPrivacyControlRead onlyExperimental

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

WorkerNavigator.gpuRead onlySecure context

Returns theGPU object for the current worker context. The entry point for theWebGPU API.

WorkerNavigator.hardwareConcurrencyRead only

Returns the number of logical processor cores available.

WorkerNavigator.hidRead onlyExperimentalSecure context

Returns anHID object providing methods for connecting to HID devices already granted permission by the user and listing attached HID devices, and event handlers for responding to HID devices connecting and disconnecting.

WorkerNavigator.languageRead only

Returns a string representing the preferred language of the user, usually the language of the browser UI. Thenull value is returned when this is unknown.

WorkerNavigator.languagesRead only

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

WorkerNavigator.locksRead onlySecure context

Returns aLockManager object which provides methods for requesting a newLock object and querying for an existingLock object.

WorkerNavigator.mediaCapabilitiesRead only

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

WorkerNavigator.onLineRead only

Returns a boolean value indicating whether the browser is online.

WorkerNavigator.permissionsRead only

Returns aPermissions object that can be used to query and update permission status of APIs covered by thePermissions API.

WorkerNavigator.platformDeprecatedRead only

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

WorkerNavigator.productDeprecatedRead only

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

WorkerNavigator.serialRead onlyExperimentalSecure context

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

WorkerNavigator.serviceWorkerRead onlySecure context

Returns aServiceWorkerContainer object, which provides access to registration, removal, upgrade, and communication with theServiceWorker objects for theassociated document.

WorkerNavigator.storageRead onlySecure context

Returns aStorageManager interface for managing persistence permissions and estimating available storage.

WorkerNavigator.usbRead onlySecure context

Returns aUSB object for the current document, providing access toWebUSB API functionality.

WorkerNavigator.userAgentRead only

Returns the user agent string for the current browser.

WorkerNavigator.userAgentDataRead onlyExperimentalSecure context

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

Instance methods

TheWorkerNavigator interface doesn't inherit any method.

WorkerNavigator.clearAppBadge()Secure context

Clears a badge on the current app's icon and returns aPromise that resolves withundefined.

WorkerNavigator.setAppBadge()Secure context

Sets a badge on the icon associated with this app and returns aPromise that resolves withundefined.

Specifications

Specification
HTML
# the-workernavigator-object

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp