Navigator

Navigator interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities.

A Navigator object can be retrieved using the read-only window.navigator 特性。

特性

Doesn't inherit any properties, but implements those defined in NavigatorID , NavigatorLanguage , NavigatorOnLine , NavigatorContentUtils , NavigatorStorage , NavigatorStorageUtils , NavigatorConcurrentHardware , NavigatorPlugins ,和 NavigatorUserMedia .

Standard properties

Navigator.connection 只读
提供 NetworkInformation object containing information about the network connection of a device.
Navigator.cookieEnabled 只读
Returns false if setting a cookie will be ignored and true otherwise.
Navigator.credentials 只读
返回 CredentialsContainer interface which exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
Navigator.deviceMemory 只读
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.
Navigator.doNotTrack 只读
Reports the value of the user's do-not-track preference. When this value is "yes", your web site or application should not track the user.
Navigator.geolocation 只读
返回 Geolocation object allowing accessing the location of the device.
NavigatorConcurrentHardware.hardwareConcurrency 只读
Returns the number of logical processor cores available.
NavigatorPlugins.javaEnabled 只读
返回 Boolean flag indicating whether the host browser is Java-enabled or not.
Navigator.keyboard 只读
返回 Keyboard object which provides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
NavigatorLanguage.language 只读
返回 DOMString representing the preferred language of the user, usually the language of the browser UI. The null value is returned when this is unknown.
NavigatorLanguage.languages 只读
Returns an array of DOMString representing the languages known to the user, by order of preference.
Navigator.locks 只读
返回 LockManager object which provides methods for requesting a new Lock object and querying for an existing Lock object
Navigator.maxTouchPoints 只读
Returns the maximum number of simultaneous touch contact points are supported by the current device.
Navigator.mediaCapabilities 只读
返回 MediaCapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities.
Navigator.mediaDevices 只读
返回引用为 MediaDevices object which can then be used to get information about available media devices ( MediaDevices.enumerateDevices() ), find out what constrainable properties are supported for media on the user's computer and user agent ( MediaDevices.getSupportedConstraints() ), and to request access to media using MediaDevices.getUserMedia() .
Navigator.mediaSession 只读
返回 MediaSession object which can be used to provide metadata that can be used by the browser to present information about the currently-playing media to the user, such as in a global media controls UI.
NavigatorPlugins.mimeTypes 只读
Returns an MimeTypeArray listing the MIME types supported by the browser.
Navigator.onLine 只读
返回 Boolean indicating whether the browser is working online.
Navigator.permissions 只读
返回 Permissions object that can be used to query and update permission status of APIs covered by the 权限 API .
NavigatorPlugins.plugins 只读
返回 PluginArray listing the plugins installed in the browser.
Navigator.presentation 只读
Returns a reference to the Presentation API.
Navigator.serviceWorker 只读
返回 ServiceWorkerContainer object, which provides access to registration, removal, upgrade, and communication with the ServiceWorker objects for the associated document .
NavigatorStorage.storage 只读
Returns the singleton StorageManager object used for managing persistence permissions and estimating available storage on a site-by-site/app-by-app basis.
NavigatorID.userAgent 只读
Returns the user agent string for the current browser.
Navigator.vendor 只读
Returns the vendor name of the current browser (e.g., "Netscape6").
Navigator.webdriver 只读
Indicates whether the user agent is controlled by automation.
Navigator.xr 只读
返回 XR object, which represents the entry point into the WebXR API .

Non-standard properties

Navigator.buildID
Returns the build identifier of the browser. In modern browsers this property now returns a fixed timestamp as a privacy measure, e.g. 20181001000000 in Firefox 64 onwards.
Navigator.securitypolicy
Returns an empty string. In Netscape 4.7x, returns "US & CA domestic policy" or "Export policy".
Navigator.standalone
Returns a boolean indicating whether the browser is running in standalone mode. Available on Apple's iOS Safari only.
Navigator.wakeLock 只读
返回 WakeLock interface you can use to request screen wake locks and prevent screen from dimming, turning off, or showing a screen saver.

弃用特性

NavigatorID.appCodeName 只读
Returns the internal "code" name of the current browser. Do not rely on this property to return the correct value.
NavigatorID.appName 只读
返回 DOMString with 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 DOMString . Do not rely on this property to return the correct value.
Navigator.activeVRDisplays 只读
Returns an array containing every VRDisplay object that is currently presenting ( VRDisplay.ispresenting is true ).
Navigator.battery 只读
返回 BatteryManager object you can use to get information about the battery charging status.
Navigator.oscpu 只读
Returns a string that represents the current operating system.
NavigatorID.platform 只读
Returns a string representing the platform of the browser. Do not rely on this function to return a significant value.
NavigatorID.product 只读
总是返回 'Gecko' , on any browser. This property is kept only for compatibility purpose.
Navigator.productSub 只读
Returns the build number of the current browser (e.g., "20060909").
Navigator.storageQuota 只读
返回 StorageQuota interface which provides means to query and request storage usage and quota information.
Navigator.vendorSub 只读
Returns the vendor version number (e.g. "6.1").

方法

Doesn't inherit any method, but implements those defined in NavigatorID , NavigatorContentUtils , NavigatorUserMedia , and NavigatorStorageUtils .

Navigator.canShare()
返回 true if a call to Navigator.share() would succeed.
Navigator.registerProtocolHandler()
Allows web sites to register themselves as a possible handler for a given protocol.
Navigator.requestMediaKeySystemAccess()
返回 Promise for a MediaKeySystemAccess object.
Navigator.sendBeacon()
Used to asynchronously transfer a small amount of data using HTTP from the User Agent to a web server.
Navigator.share()
Invokes the native sharing mechanism of the current platform.
Navigator.vibrate()
Causes vibration on devices with support for it. Does nothing if vibration support isn't available.

弃用方法

Navigator.getVRDisplays()
Returns a promise that resolves to an array of VRDisplay objects representing any available VR devices connected to the computer.
Navigator.getUserMedia()
After having prompted the user for permission, returns the audio or video stream associated to a camera or microphone on the local computer.
Navigator.registerContentHandler()
Allows web sites to register themselves as a possible handler for a given MIME type.
NavigatorID.taintEnabled()
返回 false . JavaScript taint/untaint functions removed in JavaScript 1.2.

规范

规范 状态 Comment
HTML Living Standard
The definition of 'the Navigator object' 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
Navigator Chrome 1 Edge 12 Firefox 1 IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
activeVRDisplays
弃用
Chrome 不支持 No Edge 不支持 15 — 79
注意事项
15 — 79
注意事项
WebVR content requires a Windows Mixed Reality headset or the Windows Mixed Reality Portal Simulator.
Firefox 55
注意事项
55
注意事项
Windows support was enabled in Firefox 55.
64
注意事项
macOS support was enabled in Firefox 64.
IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 79 — 80 Chrome Android 不支持 79 — 80
注意事项
79 — 80
注意事项
Supported only by Google Daydream.
Firefox Android 55 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android Yes
注意事项
Yes
注意事项
Currently supported only by Google Daydream.
authentication Chrome 67
Disabled
67
Disabled
Disabled From version 67: this feature is behind the WebAuth preference. To change preferences in Chrome, visit chrome://flags.
Edge 79
Disabled
79
Disabled
Disabled From version 79: this feature is behind the WebAuth preference.
Firefox 不支持 No IE 不支持 No Opera ? Safari 不支持 No WebView Android 不支持 No Chrome Android 67
Disabled
67
Disabled
Disabled From version 67: this feature is behind the WebAuth preference. To change preferences in Chrome, visit chrome://flags.
Firefox Android 不支持 No Opera Android ? Safari iOS 不支持 No Samsung Internet Android 不支持 No
battery
弃用
Chrome 不支持 20 — 29
Prefixed
20 — 29
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 不支持 No Firefox 不支持 16 — 50
注意事项
16 — 50
注意事项
Removed in favor of navigator.getBattery() .
The Battery API was supported on Android, Windows, and Linux with UPower installed. Support for macOS was available starting with Firefox 18.
11 — 16
Prefixed
Prefixed Implemented with the vendor prefix: moz
10 — 16
Disabled
Disabled From version 10 until version 16 (exclusive): this feature is behind the dom.battery.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 16 — 50
注意事项
16 — 50
注意事项
Removed in favor of navigator.getBattery() .
The Battery API was supported on Android, Windows, and Linux with UPower installed. Support for macOS was available starting with Firefox 18.
14 — 16
Prefixed
Prefixed Implemented with the vendor prefix: moz
10 — 16
Disabled
Disabled From version 10 until version 16 (exclusive): this feature is behind the dom.battery.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
buildID
非标
Chrome 不支持 No Edge 不支持 No Firefox 64
注意事项
64
注意事项
Returns a fixed timestamp as a privacy measure - 20181001000000 .
2
IE ? Opera ? Safari ? WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 64
注意事项
64
注意事项
Returns a fixed timestamp as a privacy measure - 20181001000000 .
Yes
Opera Android ? Safari iOS ? Samsung Internet Android 不支持 No
canShare Chrome 不支持 No Edge 不支持 No Firefox 不支持 No IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 75 Firefox Android 不支持 No Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 11.0
clipboard Chrome 66 Edge ≤79 Firefox 63 IE ? Opera Yes Safari 13.1 WebView Android 66 Chrome Android 66 Firefox Android 63 Opera Android Yes Safari iOS 13.4 Samsung Internet Android 9.0
connection
Chrome 61 Edge ≤79 Firefox Yes
Disabled
Yes
Disabled
Disabled This feature is behind the dom.netinfo.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera Yes Safari 不支持 No WebView Android 50 Chrome Android 38 Firefox Android 14
注意事项
14
注意事项
The Network API is enabled by default. Can be disabled using the dom.netinfo.enabled preference.
Opera Android 37 Safari iOS 不支持 No Samsung Internet Android 3.0
cookieEnabled Chrome 1 Edge 12 Firefox 1
注意事项
1
注意事项
Prior to Firefox 8, navigator.cookieEnabled would report the wrong result if a site exception was in place for the page on which the check was performed. This has been fixed.
IE Yes Opera Yes Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4
注意事项
4
注意事项
Prior to Firefox 8, navigator.cookieEnabled would report the wrong result if a site exception was in place for the page on which the check was performed. This has been fixed.
Opera Android Yes Safari iOS 1 Samsung Internet Android 7.0
credentials
Chrome 51 Edge 18 Firefox Yes IE ? Opera Yes Safari ? WebView Android 51 Chrome Android 51 Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android 5.0
deviceMemory
Chrome 63 Edge ≤79 Firefox ? IE ? Opera 50 Safari ? WebView Android 63 Chrome Android 63 Firefox Android ? Opera Android 46 Safari iOS ? Samsung Internet Android 8.0
doNotTrack
Chrome 23 Edge 17
注意事项
17
注意事项
Edge prior to version 17 implemented window.doNotTrack .
Firefox 9
注意事项
9
注意事项
Prior to Firefox 32, navigator.doNotTrack would report values of yes and no 而不是 1 and 0 .
IE 不支持 9 — 11
Prefixed 注意事项
9 — 11
Prefixed 注意事项
Prefixed Implemented with the vendor prefix: ms
For IE11 and subsequent versions, use window.doNotTrack
Opera 12 Safari 不支持 5.1 — 7
注意事项
5.1 — 7
注意事项
Safari 7.1.3+ uses window.doNotTrack 而不是 navigator.doNotTrack .
WebView Android Yes Chrome Android Yes Firefox Android 9
注意事项
9
注意事项
Prior to Firefox 32, navigator.doNotTrack would report values of yes and no 而不是 1 and 0 .
Opera Android ? Safari iOS ? Samsung Internet Android Yes
geolocation Chrome 5 Edge 12 Firefox 3.5 IE 9 Opera 10.6 Safari 5 WebView Android ≤37 Chrome Android 18 Firefox Android 4 Opera Android 11 Safari iOS 4.2 Samsung Internet Android 1.0
getBattery
弃用
Chrome 45 Edge 79 Firefox 不支持 43 — 52
注意事项
43 — 52
注意事项
From Firefox 52 onwards, the Battery Status API is only available in chrome/privileged code.
IE 不支持 No Opera 25 Safari 不支持 No WebView Android 45 Chrome Android 45 Firefox Android 不支持 43 — 52
注意事项
43 — 52
注意事项
From Firefox 52 onwards, the Battery Status API is only available in chrome/privileged code.
Opera Android 25 Safari iOS 不支持 No Samsung Internet Android 5.0
getGamepads
Chrome 35
35
21
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 12 Firefox 29 IE 不支持 No Opera 22
22
15
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari 不支持 No WebView Android 37
37
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 35
35
25
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 不支持 No Opera Android 22
22
14
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS 不支持 No Samsung Internet Android 3.0
3.0
1.5
Prefixed
Prefixed Implemented with the vendor prefix: webkit
getUserMedia
弃用 非标
Chrome 53
53
21
Prefixed 注意事项
Prefixed Implemented with the vendor prefix: webkit
An outdated constraint syntax is still in use, but the syntax described here is available through the adapter.js polyfill.
Edge 12 Firefox 17
Prefixed 注意事项
17
Prefixed 注意事项
Prefixed Implemented with the vendor prefix: moz
The constraint syntax described here is available as of Firefox 38. Earlier versions (32-37) used an outdated constraint syntax, but the syntax described here is available there through the adapter.js polyfill.
IE 不支持 No Opera 18
Prefixed
18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
12 — 15
注意事项
An outdated constraint syntax is still in use, but the syntax described here is available through the adapter.js polyfill.
Safari 不支持 No WebView Android 53
53
40
Prefixed 注意事项
Prefixed Implemented with the vendor prefix: webkit
An outdated constraint syntax is still in use, but the syntax described here is available through the adapter.js polyfill.
Chrome Android 53
53
25
Prefixed 注意事项
Prefixed Implemented with the vendor prefix: webkit
An outdated constraint syntax is still in use, but the syntax described here is available through the adapter.js polyfill.
Firefox Android 24
Prefixed 注意事项
24
Prefixed 注意事项
Prefixed Implemented with the vendor prefix: moz
The constraint syntax described here is available as of Firefox 38. Earlier versions (32-37) used an outdated constraint syntax, but the syntax described here is available there through the adapter.js polyfill.
Opera Android 不支持 12 — 14
注意事项
12 — 14
注意事项
An outdated constraint syntax is still in use, but the syntax described here is available through the adapter.js polyfill.
Safari iOS 不支持 No Samsung Internet Android 6.0
6.0
1.5
Prefixed 注意事项
Prefixed Implemented with the vendor prefix: webkit
An outdated constraint syntax is still in use, but the syntax described here is available through the adapter.js polyfill.
getVRDisplays
弃用
Chrome 不支持 No
注意事项
No
注意事项
Available on all platforms behind a flag, but currently only works on desktop in an experimental version of Chrome (other builds won't return any devices when Navigator.getVRDisplays() is invoked).
Edge 不支持 15 — 79 Firefox 55
注意事项
55
注意事项
Windows support was enabled in Firefox 55.
64
注意事项
macOS support was enabled in Firefox 64.
IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 ? — 80 Chrome Android 不支持 ? — 80
注意事项
? — 80
注意事项
Currently supported only by Google Daydream.
Firefox Android 55 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
keyboard
Chrome 68 Edge 79 Firefox 不支持 No IE 不支持 No Opera 55 Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 No Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
locks
Chrome 69 Edge ≤79 Firefox ? IE ? Opera 56 Safari ? WebView Android 69 Chrome Android 69 Firefox Android ? Opera Android 48 Safari iOS ? Samsung Internet Android 10.0
maxTouchPoints Chrome 35 Edge 12 Firefox 59
59
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 11
11
10
Prefixed
Prefixed Implemented with the vendor prefix: ms
Opera Yes Safari 不支持 No WebView Android 37 Chrome Android 35 Firefox Android 29
注意事项 Disabled
29
注意事项 Disabled
bug 1426786 .
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android Yes Safari iOS 不支持 No Samsung Internet Android 3.0
mediaCapabilities
Chrome 66 Edge 79 Firefox 63 IE 不支持 No Opera 55 Safari 不支持 No WebView Android 66 Chrome Android 66 Firefox Android 63 Opera Android 48 Safari iOS 不支持 No Samsung Internet Android 9.0
mediaDevices Chrome 51 Edge 12 Firefox 36 IE Yes Opera 不支持 No Safari 不支持 No WebView Android 51 Chrome Android 51 Firefox Android 36 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 5.0
mediaSession
Chrome 不支持 No Edge 不支持 No Firefox 71 IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 57 Firefox Android ? Opera Android 不支持 No Safari iOS ? Samsung Internet Android 7.0
mozIsLocallyAvailable
弃用 非标
Chrome 不支持 No Edge 不支持 No Firefox 不支持 ? — 35 IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 ? — 35 Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
oscpu
弃用 非标
Chrome 不支持 No Edge 不支持 No Firefox Yes
注意事项
Yes
注意事项
The preference "general.oscpu.override" can be used to set a value to be returned instead of the true CPU description. The preference setting is ignored for calls made by privileged code, which continue to get the actual CPU description.
IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 不支持 No Firefox Android Yes Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 不支持 No
permissions
Chrome 43 Edge 79 Firefox 46 IE 不支持 No Opera Yes Safari 不支持 No WebView Android 不支持 No Chrome Android 43 Firefox Android 46 Opera Android Yes Safari iOS 不支持 No Samsung Internet Android 4.0
presentation Chrome Yes Edge ≤79 Firefox 51
Disabled
51
Disabled
Disabled From version 51: this feature is behind the dom.presentation.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE ? Opera Yes Safari ? WebView Android 不支持 No Chrome Android Yes Firefox Android 51
Disabled
51
Disabled
Disabled From version 51: this feature is behind the dom.presentation.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android Yes Safari iOS ? Samsung Internet Android Yes
productSub
非标
Chrome Yes
注意事项
Yes
注意事项
总是返回 20030107 .
Edge 12 Firefox Yes IE Yes
注意事项
Yes
注意事项
总是返回 undefined .
Opera Yes Safari Yes
注意事项
Yes
注意事项
总是返回 20030107 .
WebView Android Yes Chrome Android Yes
注意事项
Yes
注意事项
总是返回 20030107 .
Firefox Android Yes Opera Android Yes Safari iOS Yes
注意事项
Yes
注意事项
总是返回 20030107 .
Samsung Internet Android Yes
注意事项
Yes
注意事项
总是返回 20030107 .
registerContentHandler
弃用 非标
Chrome ? Edge ? Firefox 不支持 2 — 62 IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
registerProtocolHandler Chrome 13
注意事项
13
注意事项
Allowed schemes include mailto , mms , nntp , rtsp ,和 webcal . Custom protocols must be prefixed with web+ .
From Chrome 77, the URL parameter only accepts http or https URLs.
Edge ≤79
注意事项
≤79
注意事项
Allowed schemes include mailto , mms , nntp , rtsp ,和 webcal . Custom protocols must be prefixed with web+ .
Firefox 3 IE ? Opera 11.6 Safari ? WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 不支持 No Opera Android ? Safari iOS 不支持 No Samsung Internet Android Yes
requestMediaKeySystemAccess Chrome 42
注意事项
42
注意事项
The spec requires that the passed supportedConfigurations option contain at least one of audioCapabilities or videoCapabilities , and that said parameters include a codec string.
The function does not exist in insecure contexts. This was not enforced until Chrome 58.
Edge 13 Firefox Yes
注意事项
Yes
注意事项
Starting in Firefox 55, if neither audioCapabilities nor videoCapabilities is specified in supportedConfigurations , a warning is output to the web console.
In addition, starting in Firefox 55, if in supportedConfigurations , either audioCapabilities 's or videoCapabilities 's contentType value doesn't specify a "codecs" substring to define allowed codecs within the media wrapper, a warning is output to the web console. See note below table for example and correction.
In the future, if neither audioCapabilities nor videoCapabilities is specified in the supportedConfigurations NotSupported exception will be thrown.
IE ? Opera 29
注意事项
29
注意事项
The spec requires that the passed supportedConfigurations option contain at least one of audioCapabilities or videoCapabilities , and that said parameters include a codec string.
The function does not exist in insecure contexts. This was not enforced until Opera 45.
Safari ? WebView Android 43
注意事项
43
注意事项
The spec requires that the passed supportedConfigurations option contain at least one of audioCapabilities or videoCapabilities , and that said parameters include a codec string.
The function does not exist in insecure contexts. This was not enforced until version 58.
Chrome Android 42
注意事项
42
注意事项
The spec requires that the passed supportedConfigurations option contain at least one of audioCapabilities or videoCapabilities , and that said parameters include a codec string.
The function does not exist in insecure contexts. This was not enforced until Chrome 58.
Firefox Android Yes
注意事项
Yes
注意事项
Starting in Firefox 55, if neither audioCapabilities nor videoCapabilities is specified in supportedConfigurations , a warning is output to the web console.
In addition, starting in Firefox 55, if in supportedConfigurations , either audioCapabilities 's or videoCapabilities 's contentType value doesn't specify a "codecs" substring to define allowed codecs within the media wrapper, a warning is output to the web console. See note below table for example and correction.
In the future, if neither audioCapabilities nor videoCapabilities is specified in the supportedConfigurations NotSupported exception will be thrown.
Opera Android 29
注意事项
29
注意事项
The spec requires that the passed supportedConfigurations option contain at least one of audioCapabilities or videoCapabilities , and that said parameters include a codec string.
The function does not exist in insecure contexts. This was not enforced until Opera 45.
Safari iOS ? Samsung Internet Android 4.0
注意事项
4.0
注意事项
The spec requires that the passed supportedConfigurations option contain at least one of audioCapabilities or videoCapabilities , and that said parameters include a codec string.
The function does not exist in insecure contexts. This was not enforced until Samsung Internet 7.0.
sendBeacon Chrome 39
注意事项
39
注意事项
Starting in Chrome 59, this method cannot send a Blob whose type is not CORS safelisted. This is a temporary change until a mitigation can be found for the security issues that this creates. For more information see Chrome bug 720283 .
Edge 14 Firefox 31 IE 不支持 No Opera 26
注意事项
26
注意事项
Starting in Opera 46, this method cannot send a Blob whose type is not CORS safelisted. This is a temporary change until a mitigation can be found for the security issues that this creates. For more information see Chrome bug 720283 .
Safari 11.1 WebView Android 40
注意事项
40
注意事项
Starting in Chrome 59, this method cannot send a Blob whose type is not CORS safelisted. This is a temporary change until a mitigation can be found for the security issues that this creates. For more information see Chrome bug 720283 .
Chrome Android 42
注意事项
42
注意事项
Starting in Chrome 59, this method cannot send a Blob whose type is not CORS safelisted. This is a temporary change until a mitigation can be found for the security issues that this creates. For more information see Chrome bug 720283 .
Firefox Android 31 Opera Android 26
注意事项
26
注意事项
Starting in Opera 46, this method cannot send a Blob whose type is not CORS safelisted. This is a temporary change until a mitigation can be found for the security issues that this creates. For more information see Chrome bug 720283 .
Safari iOS 11.3 Samsung Internet Android 4.0
注意事项
4.0
注意事项
Starting in Samsung Internet 7.0, this method cannot send a Blob whose type is not CORS safelisted. This is a temporary change until a mitigation can be found for the security issues that this creates. For more information see Chrome bug 720283 .
serviceWorker Chrome 40 Edge 17
17
16
Disabled
Disabled From version 16: this feature is behind the Enable service workers preference.
Firefox 44
注意事项
44
注意事项
Extended Support Releases (ESR) before Firefox 78 ESR do not support service workers and the Push API.
IE 不支持 No Opera 27 Safari 11.1 WebView Android 40 Chrome Android 40 Firefox Android 44 Opera Android 27 Safari iOS 11.3 Samsung Internet Android 4.0
share
Chrome 不支持 No Edge 不支持 No Firefox 不支持 No IE 不支持 No Opera 不支持 No Safari 12.1 WebView Android 不支持 No Chrome Android 61 Firefox Android 不支持 No Opera Android 48 Safari iOS 12.2 Samsung Internet Android 8.0
vendor Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
vendorSub
非标
Chrome Yes Edge 12 Firefox Yes IE Yes Opera 15 Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android 14 Safari iOS Yes Samsung Internet Android Yes
vibrate Chrome 32 Edge ≤79 Firefox 16
注意事项
16
注意事项
Until Firefox 26 included, when the vibration pattern was too long or any of its elements too large, Firefox threw an exception instead of returning false ( bug 884935 ).
From Firefox 32 onwards, when the vibration pattern is too long or any of its elements too large, it returns true but truncates the pattern ( bug 1014581 ).
Beginning in Firefox 72, this is not supported in cross-origin iframes.
11
Prefixed
Prefixed Implemented with the vendor prefix: moz
IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 4.4.3
注意事项
4.4.3
注意事项
Beginning in version 55, this is not supported in cross-origin iframes.
Beginning in version 60, this method requires a user gesture. Otherwise it returns false .
Chrome Android 32
注意事项
32
注意事项
Beginning in Chrome 55, this is not supported in cross-origin iframes.
Beginning in Chrome 60, this method requires a user gesture. Otherwise it returns false .
Firefox Android 16
注意事项
16
注意事项
Until Firefox 26 included, when the vibration pattern was too long or any of its elements too large, Firefox threw an exception instead of returning false ( bug 884935 ).
From Firefox 32 onwards, when the vibration pattern is too long or any of its elements too large, it returns true but truncates the pattern ( bug 1014581 ).
14
Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android Yes
注意事项
Yes
注意事项
Beginning in Opera 47, this method requires a user gesture. Otherwise it returns false .
Safari iOS 不支持 No Samsung Internet Android 2.0
注意事项
2.0
注意事项
Beginning in Samsung Internet 6.0, this is not supported in cross-origin iframes.
Beginning in Samsung Internet 8.0, this method requires a user gesture. Otherwise it returns false .
wakeLock
Chrome 84 Edge 84 Firefox 不支持 No IE 不支持 No Opera Yes Safari 不支持 No WebView Android 84 Chrome Android 84 Firefox Android 不支持 No Opera Android Yes Safari iOS 不支持 No Samsung Internet Android Yes
webdriver
Chrome 63 Edge 12 Firefox Yes IE ? Opera 50 Safari Yes WebView Android 63 Chrome Android 63 Firefox Android Yes Opera Android 46 Safari iOS Yes Samsung Internet Android 8.0
xr
Chrome 79 Edge 79 Firefox 不支持 No IE 不支持 No Opera 不支持 No Safari 不支持 No WebView Android 不支持 No Chrome Android 79 Firefox Android 不支持 No Opera Android 不支持 No Safari iOS 不支持 No Samsung Internet Android 11.2

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
弃用。不要用于新网站。
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。
要求使用供应商前缀或不同名称。
要求使用供应商前缀或不同名称。