WorkerNavigator - Web APIs 编辑

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.connectionRead only
Provides a NetworkInformation object containing information about the network connection of a device.
WorkerNavigator.locks This is an experimental API that should not be used in production code.Read only
Returns a LockManager object which provides methods for requesting a new Lock object and querying for an existing Lock object.
WorkerNavigator.permissions This is an experimental API that should not be used in production code.Read only
Returns a Permissions object that can be used to query and update permission status of APIs covered by the Permissions API.
Navigator.storageRead only This is an experimental API that should not be used in production code.
Returns a StorageManager interface for managing persistance permissions and estimating available storage.

Inherited properties

NavigatorID.appCodeName This deprecated API should no longer be used, but will probably still work.Read only
Always returns 'Mozilla', in any browser. This property is kept only for compatibility purposes.
NavigatorID.appName This deprecated API should no longer be used, but will probably still work.Read only
Returns the official name of the browser. Do not rely on this property to return the correct value.
NavigatorID.appVersion This deprecated API should no longer be used, but will probably still work.Read 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 DOMString representing the language version of the browser. The null value 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 Boolean indicating whether the browser is online.
NavigatorID.platform This deprecated API should no longer be used, but will probably still work.Read only
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
NavigatorID.product This deprecated API should no longer be used, but will probably still work.Read 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.

Specifications

SpecificationStatusComment
HTML Living Standard
The definition of 'WorkerNavigator' in that specification.
Living Standard

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:117 次

字数:13072

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文