WorkerNavigator

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 .

特性

WorkerNavigator interface implements properties from the NavigatorID , NavigatorLanguage , NavigatorOnLine , NavigatorDataStore ,和 NavigatorConcurrentHardware 接口。

WorkerNavigator.connection 只读
提供 NetworkInformation object containing information about the network connection of a device.
WorkerNavigator.locks 只读
返回 LockManager object which provides methods for requesting a new Lock object and querying for an existing Lock 对象。
WorkerNavigator.permissions 只读
返回 Permissions object that can be used to query and update permission status of APIs covered by the 权限 API .
Navigator.storage 只读
返回 StorageManager interface for managing persistance permissions and estimating available storage.

Inherited properties

NavigatorID.appCodeName 只读
总是返回 'Mozilla' , in any browser. This property is kept only for compatibility purposes.
NavigatorID.appName 只读
Returns the official name of the browser. Do not rely on this property to return the correct value.
NavigatorID.appVersion 只读
Returns the version of the browser as a string. Do not rely on this property to return the correct value.
NavigatorConcurrentHardware.hardwareConcurrency 只读
Returns the number of logical processor cores available.
NavigatorLanguage.language 只读
返回 DOMString representing the language version of the browser. The null value is returned when this is unknown.
NavigatorLanguage.languages 只读
Returns an array of DOMString s representing the languages known to the user, in order of preference.
NavigatorOnLine.onLine 只读
返回 Boolean indicating whether the browser is online.
NavigatorID.platform 只读
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
NavigatorID.product 只读
总是返回 'Gecko' , on any browser. This property is kept only for compatibility purposes.
NavigatorID.userAgent 只读
Returns the user agent string for the current browser.

方法

WorkerNavigator interface implements methods from the NavigatorID , NavigatorLanguage and NavigatorOnLine 接口。

规范

规范 状态 Comment
HTML Living Standard
The definition of 'WorkerNavigator' in that specification.
实时标准

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
WorkerNavigator Chrome 1 Edge ≤79 Firefox 3.5 IE ? Opera Yes Safari ? WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android Yes Safari iOS ? Samsung Internet Android Yes
connection
Chrome 61 Edge ≤79 Firefox No IE No Opera Yes Safari No WebView Android 50 Chrome Android 38 Firefox Android 53 Opera Android 37 Safari iOS No Samsung Internet Android 3.0
permissions
Chrome 43 Edge ≤79 Firefox No IE ? Opera 30 Safari No WebView Android 43 Chrome Android 43 Firefox Android No Opera Android 30 Safari iOS No Samsung Internet Android 4.0
serviceWorker Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。

另请参阅