Window

Window 接口表示的窗口包含 DOM 文档; document 特性指向 DOM 文档 加载在相应窗口中。 可以获得给定文档的窗口使用 document.defaultView 特性。

全局变量 window 表示的窗口脚本在其中运行,并暴露给 JavaScript 代码。

Window 接口是各种函数、名称空间、对象及构造函数的家园,它们不必直接关联用户界面窗口概念。不管怎样, Window 接口是包括这些需要全局可用的项的合适位置。其中许多被文档化在 JavaScript 参考 DOM 参考 .

在选项卡式浏览器中,表示每个选项卡通过它自己的 Window 对象;全局 window 理解始终在其中运行代码的选项卡表示,通过在给定选项卡中运行 JavaScript 代码。也就是说,即使在选项卡式浏览器中,某些特性和方法仍适用于包含选项卡的整个窗口,如 resizeTo() and innerHeight 。通常,不能合理附属于选项卡的任何东西都属于窗口。

构造函数

另请参阅 DOM 接口 .

DOMParser
DOMParser can parse XML or HTML source stored in a string into a DOM Document . DOMParser is specified in DOM 剖析和序列化 .
Image
用于创建 HTMLImageElement .
Option
用于创建 HTMLOptionElement .
StaticRange 只读
返回 StaticRange() 构造函数,创建 StaticRange 对象。
Worker
用于创建 Web 工作者。
XMLSerializer
把 DOM 树转换成 XML 或 HTML 源代码。

特性

此接口继承的特性来自 EventTarget 接口和实现的特性来自 WindowOrWorkerGlobalScope and WindowEventHandlers mixins.

Note that properties which are objects (e.g.,. for overriding the prototype of built-in elements) are listed in a separate section below.

Window.closed 只读
此特性指示当前窗口是否被关闭。
Window.console 只读
Returns a reference to the console object which provides access to the browser's debugging console.
Window.controllers 只读
Returns the XUL controller objects for the current chrome window.
Window.customElements 只读
Returns a reference to the CustomElementRegistry object, which can be used to register new 自定义元素 and get information about previously registered custom elements.
Window.crypto 只读
返回浏览器加密对象。
Window.devicePixelRatio 只读
Returns the ratio between physical pixels and device independent pixels in the current display.
Window.document 只读
Returns a reference to the document that the window contains.
Window.DOMMatrix 只读
返回引用为 DOMMatrix object, which represents 4x4 matrices, suitable for 2D and 3D operations.
Window.DOMMatrixReadOnly 只读
返回引用为 DOMMatrixReadOnly object, which represents 4x4 matrices, suitable for 2D and 3D operations.
Window.DOMPoint 只读
返回引用为 DOMPoint object, which represents a 2D or 3D point in a coordinate system.
Window.DOMPointReadOnly 只读
返回引用为 DOMPointReadOnly object, which represents a 2D or 3D point in a coordinate system.
Window.DOMQuad 只读
返回引用为 DOMQuad object, which provides represents a quadrilaterial object, that is one having four corners and four sides.
Window.DOMRect 只读
返回引用为 DOMRect object, which represents a rectangle.
Window.DOMRectReadOnly 只读
返回引用为 DOMRectReadOnly object, which represents a rectangle.
Window.event 只读
返回 current event , which is the event currently being handled by the JavaScript code's context, or undefined if no event is currently being handled. The Event object passed directly to event handlers should be used instead whenever possible.
Window.frameElement 只读
Returns the element in which the window is embedded, or null if the window is not embedded.
Window.frames 只读
Returns an array of the subframes in the current window.
Window.fullScreen
This property indicates whether the window is displayed in full screen or not.
Window.history 只读
Returns a reference to the history object.
Window.innerHeight 只读
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
Window.innerWidth 只读
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
Window.isSecureContext 只读
Indicates whether a context is capable of using features that require secure contexts.
Window.length 只读
Returns the number of frames in the window. See also window.frames .
Window.location
Gets/sets the location, or current URL, of the window object.
Window.locationbar 只读
Returns the locationbar object, whose visibility can be toggled in the window.
Window.localStorage 只读
Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
Window.menubar 只读
Returns the menubar object, whose visibility can be toggled in the window.
Window.messageManager
返回 message manager object for this window.
Window.mozInnerScreenX 只读
Returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel in nsIDOMWindowUtils for a conversion factor to adapt to screen pixels if needed.
Window.mozInnerScreenY 只读
Returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed.
Window.name
Gets/sets the name of the window.
Window.navigator 只读
Returns a reference to the navigator object.
Window.opener
Returns a reference to the window that opened this current window.
Window.outerHeight 只读
Gets the height of the outside of the browser window.
Window.outerWidth 只读
Gets the width of the outside of the browser window.
Window.pageXOffset 只读
别名为 window.scrollX .
Window.pageYOffset 只读
别名为 window.scrollY
Window.parent 只读
Returns a reference to the parent of the current window or subframe.
Window.performance 只读
返回 Performance object, which includes the timing and navigation attributes, each of which is an object providing performance-related data. See also 使用导航计时 for additional information and examples.
Window.personalbar 只读
Returns the personalbar object, whose visibility can be toggled in the window.
Window.screen 只读
Returns a reference to the screen object associated with the window.
Window.screenX and Window.screenLeft 只读
Both properties return the horizontal distance from the left border of the user's browser viewport to the left side of the screen.
Window.screenY and Window.screenTop 只读
Both properties return the vertical distance from the top border of the user's browser viewport to the top side of the screen.
Window.scrollbars 只读
Returns the scrollbars object, whose visibility can be toggled in the window.
Window.scrollMaxX 只读
The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
Window.scrollMaxY 只读
The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
Window.scrollX 只读
Returns the number of pixels that the document has already been scrolled horizontally.
Window.scrollY 只读
Returns the number of pixels that the document has already been scrolled vertically.
Window.self 只读
Returns an object reference to the window object itself.
Window.sessionStorage
Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
Window.sidebar 只读
Returns a reference to the window object of the sidebar.
Window.speechSynthesis 只读
返回 SpeechSynthesis object, which is the entry point into using Web 语音 API speech synthesis functionality.
Window.status
Gets/sets the text in the statusbar at the bottom of the browser.
Window.statusbar 只读
Returns the statusbar object, whose visibility can be toggled in the window.
Window.toolbar 只读
Returns the toolbar object, whose visibility can be toggled in the window.
Window.top 只读
Returns a reference to the topmost window in the window hierarchy. This property is read only.
Window.visualViewport 只读
返回 VisualViewport object which represents the visual viewport for a given window.
Window.window 只读
Returns a reference to the current window.
window[0] , window[1] , etc.
Returns a reference to the window object in the frames. See Window.frames 了解更多细节。

从其它地方实现的特性

WindowOrWorkerGlobalScope.caches 只读
返回 CacheStorage object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
WindowOrWorkerGlobalScope.indexedDB 只读
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an IDBFactory 对象。
WindowOrWorkerGlobalScope.isSecureContext 只读
Returns a boolean indicating whether the current context is secure ( true ) or not ( false ).
WindowOrWorkerGlobalScope.origin 只读
Returns the global object's origin, serialized as a string. (This does not yet appear to be implemented in any browser.)

弃用特性

Window.content and Window._content 只读
Returns a reference to the content element in the current window. Since Firefox 57 (initially Nightly-only), both versions are only available from chrome (privileged) code, and not available to the web anymore.
Window.defaultStatus
Gets/sets the status bar text for the given window.
Window.dialogArguments 只读
Gets the arguments passed to the window (if it's a dialog box) at the time window.showModalDialog() was called. This is an nsIArray .
Window.directories
Synonym of window.personalbar
Window.globalStorage
Multiple storage objects that were used for storing data across multiple pages.
Window.mozAnimationStartTime
The time in milliseconds since epoch at which the current animation cycle began. Use Animation.startTime 代替。
Window.mozPaintCount
Returns the number of times the current document has been rendered to the screen in this window. This can be used to compute rendering performance.
Window.orientation 只读
Returns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.
Window.pkcs11
Formerly provided access to install and remove PKCS11 modules.
Window.returnValue
The return value to be returned to the function that called window.showModalDialog() to display the window as a modal dialog.

方法

此接口继承的方法来自 EventTarget 接口和实现的方法来自 WindowOrWorkerGlobalScope and EventTarget .

Window.alert()
显示警报对话框。
Window.blur()
Sets focus away from the window.
Window.cancelAnimationFrame()
Enables you to cancel a callback previously scheduled with Window.requestAnimationFrame .
Window.cancelIdleCallback()
Enables you to cancel a callback previously scheduled with Window.requestIdleCallback .
Window.clearImmediate()
Cancels the repeated execution set using setImmediate .
Window.close()
Closes the current window.
Window.confirm()
Displays a dialog with a message that the user needs to respond to.
Window.dump()
Writes a message to the console.
Window.find()
Searches for a given string in a window.
Window.focus()
Sets focus on the current window.
Window.getComputedStyle()
Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
Window.getDefaultComputedStyle()
Gets default computed style for the specified element, ignoring author stylesheets.
Window.getSelection()
Returns the selection object representing the selected item(s).
Window.matchMedia()
返回 MediaQueryList object representing the specified media query string.
Window.maximize()
FIXME: NeedsContents
Window.minimize() (top-level XUL windows only)
Minimizes the window.
Window.moveBy()
Moves the current window by a specified amount.
Window.moveTo()
Moves the window to the specified coordinates.
Window.open()
打开新窗口。
Window.postMessage()
Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first.
Window.print()
Opens the Print Dialog to print the current document.
Window.prompt()
Returns the text entered by the user in a prompt dialog.
Window.requestAnimationFrame()
Tells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame.
Window.requestIdleCallback()
Enables the scheduling of tasks during a browser's idle periods.
Window.resizeBy()
Resizes the current window by a certain amount.
Window.resizeTo()
Dynamically resizes window.
Window.scroll()
Scrolls the window to a particular place in the document.
Window.scrollBy()
Scrolls the document in the window by the given amount.
Window.scrollByLines()
Scrolls the document by the given number of lines.
Window.scrollByPages()
Scrolls the current document by the specified number of pages.
Window.scrollTo()
Scrolls to a particular set of coordinates in the document.
Window.setImmediate()
Executes a function after the browser has finished other heavy tasks
Window.setResizable()
Toggles a user's ability to resize a window.
Window.sizeToContent()
Sizes the window according to its content.
Window.stop()
此方法停止窗口加载。
Window.updateCommands()
Updates the state of commands of the current chrome window (UI).

从其它地方实现的方法

EventTarget.addEventListener()
Register an event handler to a specific event type on the window.
EventTarget.dispatchEvent()
Used to trigger an event.
WindowOrWorkerGlobalScope.atob()
Decodes a string of data which has been encoded using base-64 encoding.
WindowOrWorkerGlobalScope.btoa()
Creates a base-64 encoded ASCII string from a string of binary data.
WindowOrWorkerGlobalScope.clearInterval()
Cancels the repeated execution set using WindowOrWorkerGlobalScope.setInterval() .
WindowOrWorkerGlobalScope.clearTimeout()
Cancels the delayed execution set using WindowOrWorkerGlobalScope.setTimeout() .
WindowOrWorkerGlobalScope.createImageBitmap()
Accepts a variety of different image sources, and returns a Promise which resolves to an ImageBitmap . Optionally the source is cropped to the rectangle of pixels originating at (sx, sy) with width sw, and height sh.
WindowOrWorkerGlobalScope.fetch()
Starts the process of fetching a resource from the network.
EventTarget.removeEventListener
Removes an event listener from the window.
WindowOrWorkerGlobalScope.setInterval()
Schedules a function to execute every time a given number of milliseconds elapses.
WindowOrWorkerGlobalScope.setTimeout()
Schedules a function to execute in a given amount of time.

弃用方法

Window.back()
Moves back one in the window history. This method is deprecated; you should instead use window.history.back() .
Window.captureEvents()
Registers the window to capture all events of the specified type.
Window.forward()
Moves the window one document forward in the history. This method is deprecated; you should instead use window.history.forward() .
Window.getAttention()
Flashes the application icon.
Window.home()
Returns the browser to the home page.
Window.openDialog()
Opens a new dialog window.
Window.releaseEvents()
Releases the window from trapping events of a specific type.
Window.showModalDialog()
Displays a modal dialog.

事件处理程序

These are properties of the window object that can be set to establish event handlers for the various things that can happen in the window that might be of interest.

This interface inherits event handlers from the EventTarget interface and implements event handlers from WindowEventHandlers .

Window.onappinstalled
Called when the page is installed as a webapp. See appinstalled 事件。
Window.onbeforeinstallprompt
An event handler property dispatched before a user is prompted to save a web site to a home screen on mobile.
Window.ondevicelight
An event handler property for any ambient light levels changes
Window.ondevicemotion
Called if accelerometer detects a change (For mobile devices)
Window.ondeviceorientation
Called when the orientation is changed (For mobile devices)
Window.ondeviceorientationabsolute
An event handler property for any device orientation changes.
Window.ondeviceproximity
An event handler property for device proximity event
Window.ongamepadconnected
Represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires).
Window.ongamepaddisconnected
Represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected event fires).
Window.onmozbeforepaint
An event handler property for the MozBeforePaint event, which is sent before repainting the window if the event has been requested by a call to the Window.mozRequestAnimationFrame() 方法。
Window.onpaint
An event handler property for paint events on the window.
Window.onrejectionhandled
An event handler for handled Promise rejection events.
Window.onuserproximity
An event handler property for user proximity events.
Window.onvrdisplayconnect
Represents an event handler that will run when a compatible VR device has been connected to the computer (when the vrdisplayconnected event fires).
Window.onvrdisplaydisconnect
Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the vrdisplaydisconnected event fires).
Window.onvrdisplayactivate
Represents an event handler that will run when a display is able to be presented to (when the vrdisplayactivate event fires), for example if an HMD has been moved to bring it out of standby, or woken up by being put on.
Window.onvrdisplaydeactivate
Represents an event handler that will run when a display can no longer be presented to (when the vrdisplaydeactivate event fires), for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
Window.onvrdisplayblur
Represents an event handler that will run when presentation to a display has been paused for some reason by the browser, OS, or VR hardware (when the vrdisplayblur event fires) — for example, while the user is interacting with a system menu or browser, to prevent tracking or loss of experience.
Window.onvrdisplayfocus
Represents an event handler that will run when presentation to a display has resumed after being blurred (when the vrdisplayfocus event fires).
Window.onvrdisplaypresentchange
represents an event handler that will run when the presenting state of a VR device changes — i.e. goes from presenting to not presenting, or vice versa (when the vrdisplaypresentchange event fires).

从其它地方实现的事件处理程序

GlobalEventHandlers.onabort
Called when the loading of a resource has been aborted, such as by a user canceling the load while it is still in progress
WindowEventHandlers.onafterprint
Called when the print dialog box is closed. See afterprint 事件。
WindowEventHandlers.onbeforeprint
Called when the print dialog box is opened. See beforeprint 事件。
WindowEventHandlers.onbeforeunload
An event handler property for before-unload events on the window.
GlobalEventHandlers.onblur
Called after the window loses focus, such as due to a popup.
GlobalEventHandlers.onchange
An event handler property for change events on the window.
GlobalEventHandlers.onclick
Called after the ANY mouse button is pressed & released
GlobalEventHandlers.ondblclick
Called when a double click is made with ANY mouse button.
GlobalEventHandlers.onclose
Called after the window is closed
GlobalEventHandlers.oncontextmenu
Called when the RIGHT mouse button is pressed
GlobalEventHandlers.onerror
Called when a resource fails to load OR when an error occurs at runtime. See error 事件。
GlobalEventHandlers.onfocus
Called after the window receives or regains focus. See focus 事件。
WindowEventHandlers.onhashchange
An event handler property for hashchange events on the window; called when the part of the URL after the hash mark ("#") changes.
GlobalEventHandlers.oninput
Called when the value of an <input> element changes
GlobalEventHandlers.onkeydown
Called when you begin pressing ANY key. See keydown 事件。
GlobalEventHandlers.onkeypress
Called when a key (except Shift, Fn, and CapsLock) is in pressed position. See keypress 事件。
GlobalEventHandlers.onkeyup
Called when you finish releasing ANY key. See keyup 事件。
WindowEventHandlers.onlanguagechange
An event handler property for languagechange events on the window.
GlobalEventHandlers.onload
在所有资源和 DOM 完全加载之后被调用。不会被调用当从缓存加载页面时 (譬如:采用后退按钮)。
WindowEventHandlers.onmessage
Is an EventHandler representing the code to be called when the message event is raised.
GlobalEventHandlers.onmousedown
Called when ANY mouse button is pressed.
GlobalEventHandlers.onmousemove
Called continously when the mouse is moved inside the window.
GlobalEventHandlers.onmouseout
Called when the pointer leaves the window.
GlobalEventHandlers.onmouseover
Called when the pointer enters the window
GlobalEventHandlers.onmouseup
Called when ANY mouse button is released
WindowEventHandlers.onoffline
Called when network connection is lost. See offline 事件。
WindowEventHandlers.ononline
Called when network connection is established. See online 事件。
WindowEventHandlers.onpagehide
Called when the user navigates away from the page, before the onunload event. See pagehide 事件。
WindowEventHandlers.onpageshow
Called after all resources and the DOM are fully loaded. See pageshow 事件。
WindowEventHandlers.onpopstate
Called when a back button is pressed.
GlobalEventHandlers.onreset
Called when a form is reset
GlobalEventHandlers.onresize
Called continuously as you are resizing the window.
GlobalEventHandlers.onscroll
Called when the scroll bar is moved via ANY means. If the resource fully fits in the window, then this event cannot be invoked
GlobalEventHandlers.onwheel
Called when the mouse wheel is rotated around any axis
GlobalEventHandlers.onselect
Called after text in an input field is selected
GlobalEventHandlers.onselectionchange
Is an EventHandler representing the code to be called when the selectionchange event is raised.
WindowEventHandlers.onstorage
Called when there is a change in session storage or local storage. See storage event
GlobalEventHandlers.onsubmit
Called when a form is submitted
WindowEventHandlers.onunhandledrejection
An event handler for unhandled Promise rejection events.
WindowEventHandlers.onunload
Called when the user navigates away from the page.

Events

监听这些事件使用 addEventListener() 或通过把事件监听器赋值给 on eventname 特性为此接口。

error
Fired when a resource failed to load, or can't be used. For example, if a script has an execution error or an image can't be found or is invalid.
Also available via the onerror 特性。
languagechange
Fired at the global scope object when the user's preferred language changes.
Also available via the onlanguagechange 特性。
orientationchange
Fired when the orientation of the device has changed.
Also available via the onorientationchange 特性。
devicemotion
Fired at a regular interval, indicating the amount of physical force of acceleration the device is receiving and the rate of rotation, if available.
deviceorientation
Fired when fresh data is available from the magnetometer orientation sensor about the current orientation of the device as compared to the Earth coordinate frame.
resize
Fired when the window has been resized.
Also available via the onresize 特性。
storage
Fired when a storage area ( localStorage or sessionStorage ) has been modified in the context of another document.
Also available via the onstorage 特性。

动画事件

animationcancel
Fired when an animation unexpectedly aborts.
Also available via the onanimationcancel 特性。
animationend
Fired when an animation has completed normally.
Also available via the onanimationend 特性。
animationiteration
Fired when an animation iteration has completed.
Also available via the onanimationiteration 特性。
animationstart
Fired when an animation starts.
Also available via the onanimationstart 特性。

剪贴板事件

clipboardchange
Fired when the system clipboard content changes.
copy
Fired when the user initiates a copy action through the browser's user interface.
Also available via the oncopy 特性。
cut
Fired when the user initiates a cut action through the browser's user interface.
Also available via the oncut 特性。
paste
Fired when the user initiates a paste action through the browser's user interface.
Also available via the onpaste 特性。

连接事件

offline
Fired when the browser has lost access to the network and the value of navigator.onLine has switched to false .
Also available via the onoffline 特性。
online
Fired when the browser has gained access to the network and the value of navigator.onLine has switched to true .
Also available via the ononline 特性。

聚焦事件

blur
Fired when an element has lost focus.
Also available via the onblur 特性。
focus
Fired when an element has gained focus.
Also available via the onfocus property

手柄事件

gamepadconnected
Fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used.
Also available via the ongamepadconnected 特性。
gamepaddisconnected
Fired when the browser detects that a gamepad has been disconnected.
Also available via the ongamepaddisconnected property

历史事件

hashchange
Fired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the # symbol).
Also available via the onhashchange 特性。
pagehide
Sent when the browser hides the current document while in the process of switching to displaying in its place a different document from the session's history. This happens, for example, when the user clicks the Back button or when they click the Forward button to move ahead in session history.
Also available through the onpagehide event handler property.
pageshow
Sent when the browser makes the document visible due to navigation tasks, including not only when the page is first loaded, but also situations such as the user navigating back to the page after having navigated to another within the same tab.
Also available using the onpageshow event handler property.
popstate
Fired when the active history entry changes.
Also available using the onpopstate event handler property.

加载 & 卸载事件

beforeunload
Fired when the window, the document and its resources are about to be unloaded.
Also available via the onbeforeunload 特性。
DOMContentLoaded
Fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
load
Fired when the whole page has loaded, including all dependent resources such as stylesheets images.
Also available via the onload 特性。
unload
Fired when the document or a child resource is being unloaded.
Also available via the onunload 特性。

清单事件

appinstalled
Fired when the browser has successfully installed a page as an application.
Also available via the onappinstalled 特性。
beforeinstallprompt
Fired when a user is about to be prompted to install a web application.
Also available via the onbeforeinstallprompt 特性。

消息事件

message
Fired when the window receives a message, for example from a call to Window.postMessage() from another browsing context.
Also available via the onmessage 特性。
messageerror
Fired when a Window object receives a message that can't be deserialized.
Also available via the onmessageerror 特性。
afterprint
Fired after the associated document has started printing or the print preview has been closed.
Also available via the onafterprint 特性。
beforeprint
Fired when the associated document is about to be printed or previewed for printing.
Also available via the onbeforeprint 特性。

承诺拒绝事件

rejectionhandled
Sent every time a JavaScript Promise is rejected, regardless of whether or not there is a handler in place to catch the rejection.
Also available through the onrejectionhandled event handler property.
unhandledrejection
Sent when a JavaScript Promise is rejected but there is no handler in place to catch the rejection.
Also available using the onunhandledrejection event handler property.

过渡事件

transitioncancel
Fired when a CSS transition is canceled.
Also available via the ontransitioncancel 特性。
transitionend
Fired when a CSS transition has completed.
Also available via the ontransitionend 特性。
transitionrun
Fired when a CSS transition is first created.
Also available via the ontransitionrun 特性。
transitionstart
Fired when a CSS transition has actually started.
Also available via the ontransitionstart 特性。

WebVR 事件

vrdisplayactivate
Fired when a VR display becomes available to be presented to, for example if an HMD has been moved to bring it out of standby, or woken up by being put on.
Also available via the onvrdisplayactivate 特性。
vrdisplayblur
Fired when presentation to a VR display has been paused for some reason by the browser, OS, or VR hardware.
Also available via the onvrdisplayblur 特性。
vrdisplayconnect
Fired when a compatible VR display is connected to the computer.
Also available via the onvrdisplayconnect 特性。
vrdisplaydeactivate
Fired when a VR display can no longer be presented to, for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
Also available via the onvrdisplaydeactivate 特性。
vrdisplaydisconnect
Fired when a compatible VR display is disconnected from the computer.
Also available via the onvrdisplaydisconnect 特性。
vrdisplayfocus
Fired when presentation to a VR display has resumed after being blurred.
Also available via the onvrdisplayfocus 特性。
vrdisplaypresentchange
Fired when the presenting state of a VR display changes — i.e. goes from presenting to not presenting, or vice versa.
Also available via the onvrdisplaypresentchange 特性。
vrdisplaypointerrestricted
Fired when the VR display's pointer input is restricted to consumption via a pointerlocked element .
Also available via the onvrdisplaypointerrestricted 特性。
vrdisplaypointerunrestricted
Fired when the VR display's pointer input is no longer restricted to consumption via a pointerlocked element .
Also available via the onvrdisplaypointerunrestricted 特性。

接口

DOM 参考 .

浏览器兼容性

更新 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
Window 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
DOMContentLoaded event Chrome 1 Edge 12 Firefox 1 IE 9 Opera 9 Safari 3.1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 2 Samsung Internet Android 1.0
OverconstrainedError
Chrome 63 Edge ≤79 Firefox ? IE ? Opera Yes Safari ? WebView Android 63 Chrome Android 63 Firefox Android ? Opera Android Yes Safari iOS ? Samsung Internet Android 8.0
afterprint event Chrome 63 Edge 12 Firefox 6 IE Yes Opera 50 Safari 13 WebView Android 63 Chrome Android 63 Firefox Android ? Opera Android 46 Safari iOS 13 Samsung Internet Android 8.0
alert Chrome 1
1
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Edge 12 Firefox 1 IE 4 Opera 3
3
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari 1 WebView Android 1
1
Starting with WebView 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Chrome Android 18
18
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Firefox Android 4 Opera Android 10.1
10.1
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari iOS 1 Samsung Internet Android 1.0
1.0
Starting with Samsung Internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
animationcancel event Chrome No Edge No Firefox 54 IE ? Opera No Safari 13.1
13.1
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 54 Opera Android No Safari iOS 13.4
13.4
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
animationend event Chrome 43
43
1
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤79
≤79
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Yes IE ? Opera ? Safari 9 WebView Android 43
43
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 43
43
18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Yes Opera Android ? Safari iOS 9 Samsung Internet Android 4.0
4.0
1.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
animationiteration event Chrome 43
43
1
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤79
≤79
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox 51 IE ? Opera ? Safari 9 WebView Android 43
43
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 43
43
18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 51 Opera Android ? Safari iOS 9 Samsung Internet Android 4.0
4.0
1.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
animationstart event Chrome 43
43
1
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤79
≤79
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox 51 IE ? Opera ? Safari 9 WebView Android 43
43
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 43
43
18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 51 Opera Android ? Safari iOS 9 Samsung Internet Android 4.0
4.0
1.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
beforeprint event Chrome 63 Edge 12 Firefox 6 IE Yes Opera 50 Safari 13 WebView Android 63 Chrome Android 63 Firefox Android ? Opera Android 46 Safari iOS 13 Samsung Internet Android 8.0
beforeunload event Chrome 1 Edge 12 Firefox 1 IE 4 Opera 12 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 12 Safari iOS 1 Samsung Internet Android 1.0
blur Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android 18 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
blur event Chrome 5 Edge 12 Firefox Yes
Yes
不支持 ? — 24
The interface for this event is Event , not FocusEvent .
IE Yes Opera 12.1 Safari 5.1 WebView Android Yes Chrome Android 18 Firefox Android Yes Opera Android 12.1 Safari iOS 5.1 Samsung Internet Android 1.0
cancelAnimationFrame Chrome Yes Edge 12 Firefox 23
23
不支持 11 — 23
Prefixed
Prefixed Implemented with the vendor prefix: moz
IE 10 Opera 15 Safari 6.1
6.1
不支持 6 — 6.1
Prefixed
Prefixed Implemented with the vendor prefix: webkit
WebView Android Yes Chrome Android Yes Firefox Android 23
23
不支持 14 — 23
Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android 14 Safari iOS 7 Samsung Internet Android Yes
cancelIdleCallback
Chrome 47 Edge 79 Firefox 55
55
53
Disabled
Disabled From version 53: this feature is behind the dom.requestIdleCallback.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera Yes Safari No WebView Android 47 Chrome Android 47 Firefox Android 55
55
53
Disabled
Disabled From version 53: this feature is behind the dom.requestIdleCallback.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 5.0
clearImmediate
非标
Chrome No Edge 12 — 79 Firefox No IE Yes Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
clipboardchange event
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
close Chrome 1 Edge 12 Firefox 1
1
Starting in Firefox 46.0.1, Window.close() can no longer close windows that weren't opened by the same script. This is a security precaution.
IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4
4
Starting in Firefox 46.0.1, Window.close() can no longer close windows that weren't opened by the same script. This is a security precaution.
Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
confirm Chrome 1
1
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Edge 12 Firefox 1 IE 4 Opera 3
3
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari 1 WebView Android 1
1
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Chrome Android 18
18
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Firefox Android 4 Opera Android 10.1
10.1
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari iOS 1 Samsung Internet Android 1.0
1.0
Starting with Samsung Internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
convertPointFromNodeToPage
非标
Chrome Yes Edge ≤18 Firefox 6 IE ? Opera ? Safari Yes
Alternate Name
Yes
Alternate Name
Alternate Name Uses the non-standard name: webkitConvertPointFromNodeToPage
WebView Android Yes Chrome Android Yes Firefox Android 6 Opera Android No Safari iOS Yes Samsung Internet Android Yes
convertPointFromPageToNode
非标
Chrome 50
50
For absolute values, use ondeviceorientationabsolute .
不支持 7 — 50
Provided absolute values, not relative.
Edge ≤18 Firefox 6
6
不支持 3.6 — 6
Alternate Name
Alternate Name Uses the non-standard name: onmozorientation
IE ? Opera ? Safari Yes
Alternate Name
Yes
Alternate Name
Alternate Name Uses the non-standard name: webkitConvertPointFromPageToNode
WebView Android 50
50
For absolute values, use ondeviceorientationabsolute .
不支持 ? — 50
Provided absolute values, not relative.
Chrome Android 50
50
For absolute values, use ondeviceorientationabsolute .
不支持 ? — 50
Provided absolute values, not relative.
Firefox Android 6
6
不支持 4 — 6
Alternate Name
Alternate Name Uses the non-standard name: onmozorientation
Opera Android No Safari iOS Yes Samsung Internet Android 5.0
5.0
For absolute values, use ondeviceorientationabsolute .
不支持 ? — 5.0
Provided absolute values, not relative.
copy event Chrome 58 Edge ≤18 Firefox Yes IE No Opera 45 Safari Yes WebView Android 58 Chrome Android 58 Firefox Android Yes Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
crypto Chrome 37 Edge 12 Firefox 34 IE 11
Prefixed
11
Prefixed
Prefixed Implemented with the vendor prefix: ms
Opera 24 Safari 6.1 WebView Android 37 Chrome Android 37 Firefox Android 34 Opera Android 24 Safari iOS 6.1 Samsung Internet Android 3.0
customElements Chrome 54 Edge 79 Firefox 63
63
不支持 59 — 63
Disabled
Disabled From version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 ? — 59
Disabled
Disabled Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ) and the dom.webcomponents.customelements.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 41 Safari 10.1 WebView Android 54 Chrome Android 54 Firefox Android 63
63
不支持 59 — 63
Disabled
Disabled From version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 ? — 59
Disabled
Disabled Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ) and the dom.webcomponents.customelements.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 41 Safari iOS 10.3 Samsung Internet Android 6.0
cut event Chrome 58 Edge ≤18 Firefox Yes IE No Opera 45 Safari Yes WebView Android 58 Chrome Android 58 Firefox Android Yes Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
devicemotion event
Chrome Yes Edge ≤18 Firefox 6 IE ? Opera Yes Safari ? WebView Android Yes Chrome Android Yes Firefox Android 6 Opera Android No Safari iOS 4.2 Samsung Internet Android Yes
deviceorientation event Chrome 7 Edge ≤18 Firefox 6
6
不支持 3.6 — 6
Alternate Name
Alternate Name Uses the non-standard name: mozOrientation
IE ? Opera 12 Safari Yes WebView Android 3 Chrome Android 18 Firefox Android 6
6
不支持 4 — 6
Alternate Name
Alternate Name Uses the non-standard name: mozOrientation
Opera Android 12 Safari iOS 4.2 Samsung Internet Android 1.0
devicePixelRatio Chrome 1 Edge 12 Firefox 18 IE 11 Opera 11.1 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 18 Opera Android 11.1 Safari iOS 1 Samsung Internet Android 1.0
dialogArguments
弃用 非标
Chrome ? Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?
document Chrome Yes 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
error event Chrome Yes Edge ≤79 Firefox Yes IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android Yes
event Chrome 1 Edge 12 Firefox 63
Disabled
63
Disabled
This was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756 ).
Disabled From version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 4 Opera 7 Safari 1.1 WebView Android 1 Chrome Android 18 Firefox Android 63
Disabled
63
Disabled
This was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756 ).
Disabled From version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
external
弃用
Chrome Yes Edge 12 Firefox Yes
Yes
From Firefox 78 AddSearchProvider() does nothing, as the specification requires.
IE ? Opera Yes Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android Yes
find
非标
Chrome 1 Edge 79 Firefox Yes IE No Opera Yes Safari Yes WebView Android Yes Chrome Android 18 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
focus Chrome 1
1
Starting in Chrome 66, opening a popup in fullscreen mode and calling this function will end fullscreen mode.
Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android 18 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
focus event Chrome Yes Edge 12 Firefox Yes
Yes
不支持 ? — 24
The interface for this event is Event , not FocusEvent .
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
frameElement Chrome Yes Edge 12 Firefox 1 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
frames Chrome Yes 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
fullScreen
非标
Chrome No Edge No Firefox 3 IE No Opera ? Safari ? WebView Android No Chrome Android No Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android No
gamepadconnected event Chrome 35
35
不支持 21 — 35
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤18 Firefox 29 IE No Opera 22
22
不支持 15 — 22
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari 10.1 WebView Android 37 Chrome Android 37 Firefox Android 32 Opera Android Yes Safari iOS No Samsung Internet Android 3.0
gamepaddisconnected event Chrome 35
35
不支持 21 — 35
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤18 Firefox 29 IE No Opera 22
22
不支持 15 — 22
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari 10.1 WebView Android 37 Chrome Android 37 Firefox Android 32 Opera Android Yes Safari iOS No Samsung Internet Android 3.0
getAttention
非标
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
getAttentionWithCycleCount
非标
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
getComputedStyle Chrome 1 Edge 12 Firefox 1
1
Before version 62 this function returned null when called on a Window with no presentation (e.g. an iframe with display: none; set). Since 62 it returns a CSSStyleDeclaration object with length 0, containing empty strings ( bug 1467722 ; also see bug 1471231 for further work).
IE 9 Opera 7.2 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4
4
Before version 62 this function returned null when called on a Window with no presentation (e.g. an iframe with display: none; set). Since 62 it returns a CSSStyleDeclaration object with length 0, containing empty strings ( bug 1467722 ; also see bug 1471231 for further work).
Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
getDefaultComputedStyle
非标
Chrome No Edge No Firefox 19 IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android 19 Opera Android No Safari iOS No Samsung Internet Android No
getSelection Chrome 1 Edge 12 Firefox 1 IE 9 Opera 9 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
globalStorage
弃用 非标
Chrome No Edge No Firefox ? — 13 IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
hashchange event Chrome 5 Edge 12 Firefox 3.6 IE 8 Opera 10.6 Safari 5 WebView Android Yes Chrome Android 18 Firefox Android 4 Opera Android 11 Safari iOS 5 Samsung Internet Android 1.0
history 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
home
弃用 非标
Chrome No Edge No Firefox 1 IE No Opera Yes Safari No WebView Android No Chrome Android No Firefox Android ? Opera Android ? Safari iOS No Samsung Internet Android No
innerHeight Chrome 1 Edge 12 Firefox 1
1
不支持 4 — 24
This property was buggy and could give a wrong value before page load in certain circumstances, see bug 641188 .
IE 9 Opera 9 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4
4
不支持 4 — 24
This property was buggy and could give a wrong value before page load in certain circumstances, see bug 641188 .
Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
innerWidth Chrome 1 Edge 12 Firefox 1
1
不支持 4 — 24
This property was buggy and could give a wrong value before page load in certain circumstances, see bug 641188 .
IE 9 Opera 9 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4
4
不支持 4 — 24
This property was buggy and could give a wrong value before page load in certain circumstances, see bug 641188 .
Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
isSecureContext Chrome Yes Edge 15 Firefox 49 IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 49 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
languagechange event Chrome 37 Edge ≤79 Firefox 32 IE No Opera 24 Safari ? WebView Android 37 Chrome Android 37 Firefox Android 4 Opera Android 24 Safari iOS ? Samsung Internet Android 4.0
languagechange event
Chrome 77 Edge 80 Firefox No IE No Opera Yes Safari No WebView Android 77 Chrome Android 77 Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android 12.0
length Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
load event Chrome 1 Edge 12 Firefox 1 IE 4 Opera 4 Safari 1.3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
localStorage Chrome 4 Edge 12 Firefox 3.5 IE 8 Opera 10.5 Safari 4 WebView Android ≤37 Chrome Android 18 Firefox Android 4 Opera Android 11 Safari iOS 3.2 Samsung Internet Android 1.0
location Chrome 1 Edge 12 Firefox 1
1
Before Firefox 57, single quotes contained in URLs were escaped when accessed via URL APIs. See bug 1386683 .
IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4
4
Before Firefox 57, single quotes contained in URLs were escaped when accessed via URL APIs. See bug 1386683 .
Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
locationbar Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
matchMedia Chrome 9 Edge 12 Firefox 6 IE 10 Opera 12.1 Safari 5.1 WebView Android ≤37 Chrome Android 18 Firefox Android 6 Opera Android 12.1 Safari iOS 5 Samsung Internet Android 1.0
maximize
非标
Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
menubar Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
message event Chrome 60 Edge ≤79 Firefox ? IE ? Opera 47 Safari ? WebView Android 60 Chrome Android 60 Firefox Android ? Opera Android 47 Safari iOS ? Samsung Internet Android 8.0
messageerror event Chrome 60 Edge ≤79 Firefox 57 IE ? Opera 47 Safari ? WebView Android 60 Chrome Android 60 Firefox Android 57 Opera Android 47 Safari iOS ? Samsung Internet Android 8.0
minimize
非标
Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
moveBy Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
moveTo Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
mozAnimationStartTime
非标
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
mozInnerScreenX
非标
Chrome No Edge No Firefox Yes 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
mozInnerScreenY
非标
Chrome No Edge No Firefox Yes 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
mozPaintCount
弃用 非标
Chrome No Edge No Firefox 4 — 72 IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android 4 Opera Android No Safari iOS No Samsung Internet Android No
name Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
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
offline event Chrome Yes 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
onappinstalled
弃用 非标
Chrome 64 Edge ≤79 Firefox 49 — 76
Disabled
不支持 49 — 76
Disabled
Disabled From version 49 until version 76 (exclusive): this feature is behind the dom.manifest.onappinstall preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE ? Opera No Safari ? WebView Android No Chrome Android 57 Firefox Android 49
Disabled
49
Disabled
Disabled From version 49: this feature is behind the dom.manifest.onappinstall preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android No Safari iOS ? Samsung Internet Android No
onbeforeinstallprompt
非标
Chrome Yes Edge ≤79 Firefox No IE ? Opera Yes Safari ? WebView Android Yes Chrome Android Yes Firefox Android No Opera Android Yes Safari iOS ? Samsung Internet Android Yes
ondevicelight
弃用 非标
Chrome No Edge 13 — 79 Firefox 22 — 60 IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android 15 Opera Android No Safari iOS No Samsung Internet Android No
ondevicemotion Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
ondeviceorientation Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
ondeviceorientationabsolute
非标
Chrome 50 Edge ≤79 Firefox No IE ? Opera ? Safari ? WebView Android 50 Chrome Android 50 Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android 5.0
ondeviceproximity
弃用 非标
Chrome No Edge No Firefox ? — 60 IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android 15 Opera Android No Safari iOS No Samsung Internet Android No
ongamepadconnected Chrome 35
35
不支持 21 — 35
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤18 Firefox 29 IE No Opera 22
22
不支持 15 — 22
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari 10.1 WebView Android 37 Chrome Android 35
35
不支持 25 — 35
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 32 Opera Android 22
22
不支持 14 — 22
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS No Samsung Internet Android 3.0
3.0
不支持 1.5 — 3.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
ongamepaddisconnected Chrome 35
35
不支持 21 — 35
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤18 Firefox 29 IE No Opera 22
22
不支持 15 — 22
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari 10.1 WebView Android ? Chrome Android 35
35
不支持 25 — 35
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 32 Opera Android 22
22
不支持 14 — 22
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS No Samsung Internet Android 3.0
3.0
不支持 1.5 — 3.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
online event Chrome Yes 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
onpaint
非标
Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android Yes Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
onuserproximity
弃用 非标
Chrome No Edge No Firefox Yes IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android 15 — 60 Opera Android No Safari iOS No Samsung Internet Android No
onvrdisplayactivate
弃用
Chrome No 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 No Chrome Android No Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android No
onvrdisplayblur
弃用
Chrome No Edge 15 — 79 Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
onvrdisplayconnect
弃用
Chrome No
Disabled
不支持 No
Disabled
Disabled This feature is behind the WebVR preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
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 No Chrome Android Yes
Yes
Chrome for Android 56 supports only Google Daydream View.
Chrome for Android 57 adds support for Google Cardboard.
Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android Yes
Yes
Supported on Samsung Internet for GearVR.
onvrdisplaydeactivate
弃用
Chrome No 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 No Chrome Android No Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android No
onvrdisplaydisconnect
弃用
Chrome No
Disabled
不支持 No
Disabled
Disabled This feature is behind the WebVR preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
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 No Chrome Android 56
56
Chrome for Android 56 supports only Google Daydream View.
Chrome for Android 57 adds support for Google Cardboard.
Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android 6.0
6.0
Supported on Samsung Internet for GearVR.
onvrdisplayfocus
弃用
Chrome No Edge 15 — 79 Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
onvrdisplaypointerrestricted
弃用
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
onvrdisplaypointerunrestricted
弃用
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
onvrdisplaypresentchange
弃用
Chrome 65 — 80
Disabled
不支持 65 — 80
Disabled
Disabled From version 65 until version 80 (exclusive): this feature is behind the WebVR preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Edge 15 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 No Chrome Android 56 — 80
不支持 56 — 80
Chrome for Android 56 supports only Google Daydream View.
Chrome for Android 57 adds support for Google Cardboard.
Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android 6.0
6.0
Supported on Samsung Internet for GearVR.
open 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
openDialog
非标
Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
opener Chrome 1 Edge 12 Firefox 1 IE No 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
orientation
弃用
Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
orientationchange event
弃用
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android Yes Chrome Android Yes Firefox Android 44 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
outerHeight Chrome 1 Edge 12 Firefox 1 IE 9 Opera 9 Safari 3 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android 10.1 Safari iOS 3 Samsung Internet Android Yes
outerWidth Chrome 1 Edge 12 Firefox 1 IE 9 Opera 9 Safari 3 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android 10.1 Safari iOS 3 Samsung Internet Android Yes
pagehide event Chrome 3 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android ≤37 Chrome Android 18 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
pageshow event Chrome 3 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android ≤37 Chrome Android 18 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
pageXOffset Chrome Yes Edge 12 Firefox Yes IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
pageYOffset Chrome 1 Edge 12 Firefox 1 IE 9 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
parent Chrome 1 Edge 12 Firefox 1 IE 9 Opera 3 Safari 1.3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
paste event Chrome 58 Edge 12 Firefox Yes IE 11 Opera 45 Safari Yes WebView Android 58 Chrome Android 58 Firefox Android Yes Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
performance Chrome 6 Edge 12 Firefox 7 IE 9 Opera 15 Safari 8 WebView Android Yes Chrome Android Yes Firefox Android 7 Opera Android 14 Safari iOS 9 Samsung Internet Android Yes
personalbar Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
pkcs11
弃用 非标
Chrome No Edge No Firefox ? — 29 IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android ? — 29 Opera Android ? Safari iOS ? Samsung Internet Android No
popstate event Chrome 5
5
Before version 34, Chrome would fire a popstate event on page load.
Edge 12 Firefox 4
4
Firefox emits a popstate event on page load.
IE 10 Opera 11.5 Safari 6
6
Before version 10, Safari would fire a popstate event on page load.
WebView Android ≤37
≤37
Before version 37, WebView would fire a popstate event on page load.
Chrome Android 18
18
Before version 34, Chrome would fire a popstate event on page load.
Firefox Android 4
4
Firefox emits a popstate event on page load.
Opera Android 11.5 Safari iOS 5.1
5.1
Before version 10, Safari would fire a popstate event on page load.
Samsung Internet Android 1.0
1.0
Before version 2.0, Samsung Internet would fire a popstate event on page load.
postMessage Chrome 1 Edge 12 Firefox 8
8
Supports sending File and FileList objects between windows. This is only allowed if the recipient's principal is contained within the sender's principal for security reasons.
6
message parameter is serialized using the structured clone algorithm . This means you can pass a broad variety of data objects safely to the destination window without having to serialize them yourself.
不支持 3 — 6
message parameter must be a string.
IE 10
10
IE10 had an important limitation: see this 文章 了解细节。
不支持 8 — 10
Support only for <frame> and <iframe> .
Opera 9.5 Safari 4 WebView Android 1 Chrome Android 18 Firefox Android 8
8
Supports sending File and FileList objects between windows. This is only allowed if the recipient's principal is contained within the sender's principal for security reasons.
6
message parameter is serialized using the structured clone algorithm . This means you can pass a broad variety of data objects safely to the destination window without having to serialize them yourself.
不支持 4 — 6
message parameter must be a string.
Opera Android 10.1 Safari iOS 3.2 Samsung Internet Android 1.0
print Chrome 1
1
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Edge 12 Firefox 1 IE 5 Opera 6
6
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari 1.1 WebView Android 1
1
Starting with WebView 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Chrome Android 18
18
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Firefox Android No
不支持 No
bug 1247609 .
Opera Android 10.1
10.1
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari iOS 1 Samsung Internet Android 1.0
1.0
Starting with Samsung Internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
prompt Chrome 1
1
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Edge 12 Firefox 1 IE 4
4
This function has no effect in the Modern UI/Metro version of Internet Explorer for Windows 8. It does not display a prompt to the user, and always returns undefined . It is not clear whether this is a bug or intended behavior. Desktop versions of IE do implement this function.
Opera 3
3
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari 1 WebView Android 1
1
Starting with WebView 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Chrome Android 18
18
Starting with Chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Firefox Android 4 Opera Android 10.1
10.1
Starting with Opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
Safari iOS 1 Samsung Internet Android 1.0
1.0
Starting with Samsung Internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals .
rejectionhandled event Chrome 49 Edge ≤79 Firefox 69
69
68
Disabled
Disabled From version 68: this feature is behind the dom.promise_rejection_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 36 Safari 11 WebView Android 49 Chrome Android 49 Firefox Android 68
Disabled
68
Disabled
Disabled From version 68: this feature is behind the dom.promise_rejection_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 36 Safari iOS 11.3 Samsung Internet Android 5.0
releaseEvents
弃用 非标
Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
requestAnimationFrame Chrome 24
24
10
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 12 Firefox 23
23
Callback parameter is a DOMHighResTimestamp . This means ten microsecond precision and zero time as performance.now() .
不支持 11 — 42
Prefixed
Prefixed Implemented with the vendor prefix: moz
Callback parameter is a DOMTimestamp . This means millisecond precision and zero time as Date.now() .
不支持 4 — 11
Prefixed
Prefixed Implemented with the vendor prefix: moz
Could be called with no input parameters.
IE 10 Opera 15
15
15
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari 6.1
6.1
6
Prefixed
Prefixed Implemented with the vendor prefix: webkit
WebView Android ≤37
≤37
≤37
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 25
25
18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 23
23
不支持 14 — 42
Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android 14
14
14
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS 7
7
6.1
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Samsung Internet Android 1.5
1.5
1.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
requestFileSystem
非标
Chrome 13
Prefixed
13
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤18
Prefixed
≤18
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox No IE No Opera No Safari No WebView Android 37
Prefixed
37
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
requestIdleCallback
Chrome 47 Edge 79 Firefox 55
55
Enabled by default.
不支持 53 — 55
Implemented but disabled by default.
IE No Opera 34 Safari No WebView Android 47 Chrome Android 47 Firefox Android 55
55
Enabled by default.
不支持 53 — 55
Implemented but disabled by default.
Opera Android 34 Safari iOS No Samsung Internet Android 5.0
resize event Chrome 1
1
Chrome does not emit a resize event on page load.
Edge 12
12
Prior to Edge 79, Edge emitted a resize event on page load. This is no longer the case.
Firefox 1
1
Prior to Firefox 68, Firefox emitted a resize event on page load. This is no longer the case.
IE 4 Opera 7
7
Opera does not emit a resize event on page load.
Safari 1.1 WebView Android 1
1
Webview does not emit a resize event on page load.
Chrome Android 18
18
Chrome does not emit a resize event on page load.
Firefox Android 4
4
Prior to Firefox 68, Firefox emitted a resize event on page load. This is no longer the case.
Opera Android 10.1
10.1
Opera does not emit a resize event on page load.
Safari iOS 1 Samsung Internet Android 1.0
1.0
Samsung Internet does not emit a resize event on page load.
resizeBy Chrome Yes Edge 12 Firefox Yes
Yes
Since Firefox 7, it's no longer possible for a web site to change the default size of a window in a browser if the window wasn't created by window.open or contains more than one tab. See here 了解更多细节。
IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
resizeTo Chrome Yes Edge 12 Firefox Yes
Yes
Since Firefox 7, it's no longer possible for a web site to change the default size of a window in a browser if the window wasn't created by window.open or contains more than one tab. See here 了解更多细节。
IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
resolveLocalFileSystemURL
非标
Chrome 13
Prefixed
13
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤79
Prefixed
≤79
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox No IE No Opera No Safari No WebView Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes
Prefixed
Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
restore Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
returnValue Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
routeEvent
弃用 非标
Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
screen Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
screenLeft Chrome Yes Edge 12 Firefox 64 IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 64 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
screenTop Chrome Yes Edge 12 Firefox 64 IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 64 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
screenX Chrome Yes Edge 12 Firefox Yes
Yes
Before Firefox 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value of screenPixelsPerCSSPixel of 1 for any device.
IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes
Yes
Before Firefox 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value of screenPixelsPerCSSPixel of 1 for any device.
Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
screenY Chrome Yes Edge 12 Firefox Yes
Yes
Before Firefox 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value of screenPixelsPerCSSPixel of 1 for any device.
IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes
Yes
Before Firefox 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value of screenPixelsPerCSSPixel of 1 for any device.
Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
scroll 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
scrollbars Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
scrollBy Chrome 1 Edge 79
79
不支持 12 — 79
Only scrollBy(x-coord, y-coord) is supported.
Firefox 1 IE 部分支持 11
部分支持 11
Only scrollBy(x-coord, y-coord) is supported.
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
scrollByLines
非标
Chrome No Edge No Firefox Yes IE ? Opera ? Safari No WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS No Samsung Internet Android No
scrollByPages
非标
Chrome No Edge No Firefox Yes IE ? Opera ? Safari No WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS No Samsung Internet Android No
scrollMaxX
非标
Chrome No Edge No Firefox Yes IE ? Opera ? Safari No WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS No Samsung Internet Android No
scrollMaxY
非标
Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
scrollTo Chrome 1 Edge 12 Firefox 1 IE 4 Opera 4 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
scrollX Chrome Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Edge ≤18
≤18
12
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Firefox Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
IE No
不支持 No
9
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Opera Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Safari Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
WebView Android Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Chrome Android Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Firefox Android Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Opera Android Yes
Yes
?
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Safari iOS Yes
Yes
?
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
Samsung Internet Android Yes
Yes
Yes
Alternate Name
Alternate Name Uses the non-standard name: pageXOffset
scrollY Chrome 1
1
1
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Edge ≤18
≤18
12
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Firefox 1
1
1
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
IE 9
Alternate Name
9
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Opera 9.6
9.6
4
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Safari 1
1
1
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
WebView Android 1
1
1
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Chrome Android 18
18
18
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Firefox Android 4
4
4
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Opera Android 10.1
10.1
10.1
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Safari iOS 1
1
1
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
Samsung Internet Android 1.0
1.0
1.0
Alternate Name
Alternate Name Uses the non-standard name: pageYOffset
self Chrome Yes 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
sessionStorage Chrome 5 Edge 12 Firefox 2 IE 8 Opera 10.5 Safari 4 WebView Android ≤37 Chrome Android 18 Firefox Android 4 Opera Android 11 Safari iOS 3.2 Samsung Internet Android 1.0
setCursor
非标
Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
setImmediate
非标
Chrome No Edge 12 — 79 Firefox No IE 10 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
setResizable
非标
Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
showModalDialog
弃用 非标
Chrome ? — 43 Edge No Firefox 3 — 56 IE 4 Opera No Safari 5.1
5.1
WebKit bug 151885 for possible future removal from Safari.
WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
sidebar
弃用 非标
Chrome No Edge No Firefox Yes
Yes
From Firefox 78 AddSearchProvider() does nothing, as the specification requires.
IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
sizeToContent
非标
Chrome No Edge No Firefox Yes
Yes
20
The mimimal size is clamped to prevent the window from being too small for the user to interact with.
IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes
Yes
This method has no effect as a page is always in a tab.
Opera Android ? Safari iOS ? Samsung Internet Android No
speechSynthesis Chrome 33 Edge 14 Firefox 49 IE No Opera Yes Safari 7 WebView Android 37 Chrome Android Yes Firefox Android No Opera Android No Safari iOS 7 Samsung Internet Android Yes
status Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
statusbar Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
stop Chrome Yes Edge 14 Firefox Yes IE No Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
storage event Chrome 1 Edge ≤18 Firefox 45 IE ? Opera 15 Safari ? WebView Android ≤37 Chrome Android 18 Firefox Android 45 Opera Android 14 Safari iOS ? Samsung Internet Android 1.0
toolbar Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
top Chrome Yes Edge 12 Firefox Yes
Yes
Starting in Firefox 6, this property is read only, as defined by the standard.
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
transitioncancel event Chrome No Edge No Firefox 53 IE ? Opera ? Safari 13.1
13.1
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 53 Opera Android ? Safari iOS 13.4
13.4
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
transitionend event Chrome No Edge No Firefox 51 IE ? Opera ? Safari Yes WebView Android No Chrome Android No Firefox Android 51 Opera Android ? Safari iOS Yes Samsung Internet Android No
transitionrun event Chrome No Edge No Firefox 53 IE ? Opera ? Safari 13.1
13.1
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 53 Opera Android ? Safari iOS 13.4
13.4
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
transitionstart event Chrome No Edge No Firefox 53 IE ? Opera ? Safari 13.1
13.1
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 53 Opera Android ? Safari iOS 13.4
13.4
12
Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
unhandledrejection event Chrome 49 Edge ≤79 Firefox 69
69
68
Disabled
Disabled From version 68: this feature is behind the dom.promise_rejection_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 36 Safari 11 WebView Android 49 Chrome Android 49 Firefox Android 68
Disabled
68
Disabled
Disabled From version 68: this feature is behind the dom.promise_rejection_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 36 Safari iOS 11.3 Samsung Internet Android 5.0
unload event Chrome 1 Edge 12 Firefox 1 IE 4 Opera 4 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
updateCommands
非标
Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
visualViewport
Chrome 60 Edge ≤79 Firefox 63
Disabled
63
Disabled
Disabled From version 63: this feature is behind the dom.visualviewport.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE ? Opera 47 Safari 13 WebView Android 60 Chrome Android 60 Firefox Android 63
Disabled
63
Disabled
Disabled From version 63: this feature is behind the dom.visualviewport.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 44 Safari iOS 13 Samsung Internet Android 8.0
vrdisplayactivate event
Chrome No Edge No 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 No Chrome Android No Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android No
vrdisplayblur event
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
vrdisplayconnect event
Chrome No
Disabled
不支持 No
Disabled
Disabled This feature is behind the WebVR preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
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 No Chrome Android Yes
Yes
Chrome for Android 56 supports only Google Daydream View.
Chrome for Android 57 adds support for Google Cardboard.
Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android Yes
Yes
Supported on Samsung Internet for GearVR.
vrdisplaydeactivate event
Chrome No Edge No 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 No Chrome Android No Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android No
vrdisplaydisconnect event
Chrome No
Disabled
不支持 No
Disabled
Disabled This feature is behind the WebVR preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
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 No Chrome Android 56
56
Chrome for Android 56 supports only Google Daydream View.
Chrome for Android 57 adds support for Google Cardboard.
Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android 6.0
6.0
Supported on Samsung Internet for GearVR.
vrdisplayfocus event
Chrome No Edge 15 — 79 Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
vrdisplaypointerrestricted event
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
vrdisplaypointerunrestricted event
Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
vrdisplaypresentchange event
Chrome 65
Disabled
65
Disabled
Disabled From version 65: this feature is behind the WebVR preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Edge 15 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 No Chrome Android 56
56
Chrome for Android 56 supports only Google Daydream View.
Chrome for Android 57 adds support for Google Cardboard.
Firefox Android 55 Opera Android No Safari iOS No Samsung Internet Android 6.0
6.0
Supported on Samsung Internet for GearVR.
window Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

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