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

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

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

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

  <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/Window" target="_top"><rect x="1" y="1" width="75" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text  x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Window</text></a></svg></div>
					
  a:hover text { fill: #0095DD; pointer-events: all;}
					

构造函数

另请参阅 DOM 接口 .

DOMParser
DOMParser 可以将以字符串形式存储的 XML 或 HTML 源解析成 DOM Document . DOMParser 指定在 DOM 剖析和序列化 .
图像
用于创建 HTMLImageElement .
选项
用于创建 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 只读
返回引用针对 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 只读
返回 当前事件 , which is the event currently being handled by the JavaScript code's context, or undefined if no event is currently being handled. The 事件 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 只读

返回对历史对象的引用。

Window.innerHeight 只读

获取浏览器窗口的内容区域高度,包括水平滚动条 (若有呈现)。

Window.innerWidth 只读

获取浏览器窗口的内容区域宽度,包括垂直滚动条 (若有呈现)。

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

获取/设置窗口对象的位置 (或当前 URL)。

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
返回 消息管理器 对象为此窗口。
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 只读

返回当前窗口或子框架的父级的引用。

Window.performance 只读
返回 性能 object, which includes the timing and navigation attributes, each of which is an object providing 性能相关 data. See also 使用导航计时 for additional information and examples.
Window.personalbar 只读

返回可见性可以在窗口中触发的 personalbar 对象。

Window.screen 只读

返回窗口关联的屏幕对象的引用。

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 只读

返回可见性可以在窗口中触发的滚动条对象。

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 只读

返回窗口对象本身的对象引用。

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 对象,其是入口点为使用 Web 语音 API 语音合成功能。
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 只读

返回当前窗口的引用。

window[0] , window[1] ,等。
返回引用针对 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 ) 或不 ( 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
同义词的 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()

把聚焦从窗口移开。

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()

关闭当前窗口。

Window.confirm()

Displays a dialog with a message that the user needs to respond to.

Window.dump()

把消息写入控制台。

Window.find()

在窗口中搜索给定字符串。

Window.focus()

设置聚焦当前窗口。

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()

返回表示选中项的选定对象。

Window.matchMedia()
返回 MediaQueryList object representing the specified media query string.
Window.maximize()
FIXME: NeedsContents
Window.minimize() (仅顶层 XUL 窗口)

最小化窗口。

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()

将窗口卷动到文档特定位置。

Window.scrollBy()

按给定数量卷动窗口文档。

Window.scrollByLines()

按给定行数卷动文档。

Window.scrollByPages()

按指定页数卷动当前文档。

Window.scrollTo()

滚动到文档中的一组特定坐标。

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()

更新当前 Chrome 窗口 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 事件激发)。
Window.ongamepaddisconnected
Represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected 事件激发)。
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 拒绝事件。
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 事件激发)。
Window.onvrdisplaydisconnect
Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the vrdisplaydisconnected 事件激发)。
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 事件激发)。
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 事件激发)。

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

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
EventHandler 表示要调用的代码当 message 事件被引发。
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

被调用,在选中输入字段中的文本后。

GlobalEventHandlers.onselectionchange
EventHandler 表示要调用的代码当 selectionchange 事件被引发。
WindowEventHandlers.onstorage
Called when there is a change in session storage or local storage. See storage event
GlobalEventHandlers.onsubmit

被调用当提交表单时

WindowEventHandlers.onunhandledrejection
An event handler for unhandled Promise 拒绝事件。
WindowEventHandlers.onunload

Called when the user navigates away from the page.

事件

监听这些事件使用 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.
也可用凭借 onerror 特性。
languagechange
Fired at the global scope object when the user's preferred language changes.
也可用凭借 onlanguagechange 特性。
orientationchange
Fired when the orientation of the device has changed.
也可用凭借 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.
也可用凭借 onresize 特性。
storage
被激发当存储区域 ( localStorage or sessionStorage ) 已在另一文档上下文中被修改。
也可用凭借 onstorage 特性。

动画事件

animationcancel
被激发当动画意外中止。
也可用凭借 onanimationcancel 特性。
animationend
被激发当动画已正常完成。
也可用凭借 onanimationend 特性。
animationiteration
被激发当动画迭代已完成。
也可用凭借 onanimationiteration 特性。
animationstart
被激发当动画开始。
也可用凭借 onanimationstart 特性。

剪贴板事件

clipboardchange

Fired when the system clipboard content changes.

copy
Fired when the user initiates a copy action through the browser's user interface.
也可用凭借 oncopy 特性。
cut
Fired when the user initiates a cut action through the browser's user interface.
也可用凭借 oncut 特性。
paste
Fired when the user initiates a paste action through the browser's user interface.
也可用凭借 onpaste 特性。

连接事件

offline
Fired when the browser has lost access to the network and the value of navigator.onLine has switched to false .
也可用凭借 onoffline 特性。
online
Fired when the browser has gained access to the network and the value of navigator.onLine has switched to true .
也可用凭借 ononline 特性。

聚焦事件

blur
被激发当元素已丢失聚焦。
也可用凭借 onblur 特性。
focus
被激发当元素有获得聚焦。
也可用凭借 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.
也可用凭借 ongamepadconnected 特性。
gamepaddisconnected
Fired when the browser detects that a gamepad has been disconnected.
也可用凭借 ongamepaddisconnected property

历史事件

hashchange
Fired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the # symbol).
也可用凭借 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
被激发当活动历史条目改变。
Also available using the onpopstate event handler property.

加载 & 卸载事件

beforeunload
被激发当窗口、文档及其资源即将被卸载。
也可用凭借 onbeforeunload 特性。
DOMContentLoaded

被激发当文档已完全加载并剖析,无需等待样式表、图像及子框架完成加载。

load
被激发当整个页面已加载,包括所有从属资源 (如:样式表、图像)。
也可用凭借 onload 特性。
unload
被激发当文档或子级资源正在被卸载。
也可用凭借 onunload 特性。

清单事件

appinstalled
Fired when the browser has successfully installed a page as an application.
也可用凭借 onappinstalled 特性。
beforeinstallprompt
Fired when a user is about to be prompted to install a web application.
也可用凭借 onbeforeinstallprompt 特性。

消息事件

message
Fired when the window receives a message, for example from a call to Window.postMessage() from another browsing context.
也可用凭借 onmessage 特性。
messageerror
被激发当 Window object receives a message that can't be deserialized.
也可用凭借 onmessageerror 特性。
afterprint
Fired after the associated document has started printing or the print preview has been closed.
也可用凭借 onafterprint 特性。
beforeprint
Fired when the associated document is about to be printed or previewed for printing.
也可用凭借 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
被激发当 CSS transition 被取消。
也可用凭借 ontransitioncancel 特性。
transitionend
被激发当 CSS transition 已完成。
也可用凭借 ontransitionend 特性。
transitionrun
被激发当 CSS transition is first created.
也可用凭借 ontransitionrun 特性。
transitionstart
被激发当 CSS transition has actually started.
也可用凭借 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.
也可用凭借 onvrdisplayactivate 特性。
vrdisplayblur
Fired when presentation to a VR display has been paused for some reason by the browser, OS, or VR hardware.
也可用凭借 onvrdisplayblur 特性。
vrdisplayconnect
Fired when a compatible VR display is connected to the computer.
也可用凭借 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.
也可用凭借 onvrdisplaydeactivate 特性。
vrdisplaydisconnect
Fired when a compatible VR display is disconnected from the computer.
也可用凭借 onvrdisplaydisconnect 特性。
vrdisplayfocus
Fired when presentation to a VR display has resumed after being blurred.
也可用凭借 onvrdisplayfocus 特性。
vrdisplaypresentchange
Fired when the presenting state of a VR display changes — i.e. goes from presenting to not presenting, or vice versa.
也可用凭借 onvrdisplaypresentchange 特性。
vrdisplaypointerrestricted
Fired when the VR display's pointer input is restricted to consumption via a pointerlocked element .
也可用凭借 onvrdisplaypointerrestricted 特性。
vrdisplaypointerunrestricted
Fired when the VR display's pointer input is no longer restricted to consumption via a pointerlocked element .
也可用凭借 onvrdisplaypointerunrestricted 特性。

接口

DOM 参考 .

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
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 事件 , 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
Disabled ). To change preferences in Firefox, visit
IE No Opera Yes Safari No WebView Android 47 Chrome Android 47 Firefox Android 55
55
Disabled ). To change preferences in Firefox, visit
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 ) 和 preference (needs to be set to ). 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 ) 和 preference (needs to be set to ). 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 ). 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 ). 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 事件 , 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 对象采用 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 对象采用 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
名称 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 ). To change preferences in Firefox, visit
IE ? Opera No Safari ? WebView Android No Chrome Android 57 Firefox Android 49 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 ). To change preferences in Chrome, visit
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 ). To change preferences in Chrome, visit
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 ). To change preferences in Chrome, visit
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
性能 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
Disabled ). To change preferences in Firefox, visit
IE No Opera 36 Safari 11 WebView Android 49 Chrome Android 49 Firefox Android 68 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
scrollBy(x-coord, y-coord) is supported.
Firefox 1 IE 部分支持 11
部分支持 11
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
Disabled ). To change preferences in Firefox, visit
IE No Opera 36 Safari 11 WebView Android 49 Chrome Android 49 Firefox Android 68 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 IE ? Opera 47 Safari 13 WebView Android 60 Chrome Android 60 Firefox Android 63 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 ). To change preferences in Chrome, visit
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 ). To change preferences in Chrome, visit
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 ). To change preferences in Chrome, visit
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

图例

完整支持

完整支持

部分支持

部分支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

使用非标名称。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

元数据

  • 最后修改:
  1. DOM (文档对象模型)
  2. Window
  3. 特性
    1. applicationCache
    2. caches
    3. closed
    4. console
    5. controllers
    6. crossOriginIsolated
    7. crypto
    8. customElements
    9. defaultStatus
    10. devicePixelRatio
    11. dialogArguments
    12. 目录
    13. document
    14. event
    15. frameElement
    16. frames
    17. fullScreen
    18. history
    19. indexedDB
    20. innerHeight
    21. innerWidth
    22. isSecureContext
    23. isSecureContext
    24. length
    25. localStorage
    26. location
    27. locationbar
    28. menubar
    29. mozAnimationStartTime
    30. mozInnerScreenX
    31. mozInnerScreenY
    32. mozPaintCount
    33. 名称
    34. navigator
    35. onabort
    36. onafterprint
    37. onanimationcancel
    38. onanimationend
    39. onanimationiteration
    40. onappinstalled
    41. onauxclick
    42. onbeforeinstallprompt
    43. onbeforeprint
    44. onbeforeunload
    45. onblur
    46. oncancel
    47. oncanplay
    48. oncanplaythrough
    49. onchange
    50. onclick
    51. onclose
    52. oncontextmenu
    53. oncuechange
    54. ondblclick
    55. ondevicelight
    56. ondevicemotion
    57. ondeviceorientation
    58. ondeviceorientationabsolute
    59. ondeviceproximity
    60. ondragdrop
    61. ondurationchange
    62. onended
    63. onerror
    64. onfocus
    65. onformdata
    66. ongamepadconnected
    67. ongamepaddisconnected
    68. ongotpointercapture
    69. onhashchange
    70. oninput
    71. oninvalid
    72. onkeydown
    73. onkeypress
    74. onkeyup
    75. onlanguagechange
    76. onload
    77. onloadeddata
    78. onloadedmetadata
    79. onloadend
    80. onloadstart
    81. onlostpointercapture
    82. onmessage
    83. onmessageerror
    84. onmousedown
    85. onmouseenter
    86. onmouseleave
    87. onmousemove
    88. onmouseout
    89. onmouseover
    90. onmouseup
    91. onmozbeforepaint
    92. onpaint
    93. onpause
    94. onplay
    95. onplaying
    96. onpointercancel
    97. onpointerdown
    98. onpointerenter
    99. onpointerleave
    100. onpointermove
    101. onpointerout
    102. onpointerover
    103. onpointerup
    104. onpopstate
    105. onrejectionhandled
    106. onreset
    107. onresize
    108. onscroll
    109. onselect
    110. onselectionchange
    111. onselectstart
    112. onstorage
    113. onsubmit
    114. ontouchcancel
    115. ontouchstart
    116. ontransitioncancel
    117. ontransitionend
    118. onunhandledrejection
    119. onunload
    120. onuserproximity
    121. onvrdisplayactivate
    122. onvrdisplayblur
    123. onvrdisplayconnect
    124. onvrdisplaydeactivate
    125. onvrdisplaydisconnect
    126. onvrdisplayfocus
    127. onvrdisplaypointerrestricted
    128. onvrdisplaypointerunrestricted
    129. onvrdisplaypresentchange
    130. onwheel
    131. opener
    132. origin
    133. outerHeight
    134. outerWidth
    135. pageXOffset
    136. pageYOffset
    137. parent
    138. 性能
    139. personalbar
    140. pkcs11
    141. screen
    142. screenLeft
    143. screenTop
    144. screenX
    145. screenY
    146. scrollbars
    147. scrollMaxX
    148. scrollMaxY
    149. scrollX
    150. scrollY
    151. self
    152. sessionStorage
    153. sidebar
    154. speechSynthesis
    155. status
    156. statusbar
    157. toolbar
    158. top
    159. visualViewport
    160. window
  4. 方法
    1. alert()
    2. atob()
    3. back()
    4. blur()
    5. btoa()
    6. cancelAnimationFrame()
    7. cancelIdleCallback()
    8. captureEvents()
    9. clearImmediate()
    10. clearInterval()
    11. clearTimeout()
    12. close()
    13. confirm()
    14. convertPointFromNodeToPage()
    15. convertPointFromPageToNode
    16. createImageBitmap()
    17. dump()
    18. fetch()
    19. find()
    20. focus()
    21. forward()
    22. getAttention()
    23. getComputedStyle()
    24. getDefaultComputedStyle()
    25. getSelection()
    26. home()
    27. matchMedia()
    28. minimize()
    29. moveBy()
    30. moveTo()
    31. open()
    32. openDialog()
    33. postMessage()
    34. print()
    35. prompt()
    36. queueMicrotask()
    37. releaseEvents()
    38. requestAnimationFrame()
    39. requestFileSystem()
    40. requestIdleCallback()
    41. resizeBy()
    42. resizeTo()
    43. restore()
    44. routeEvent()
    45. scroll()
    46. scrollBy()
    47. scrollByLines()
    48. scrollByPages()
    49. scrollTo()
    50. setCursor()
    51. setImmediate()
    52. setInterval()
    53. setTimeout()
    54. showModalDialog()
    55. sizeToContent()
    56. stop()
    57. updateCommands()
  5. 事件
    1. event
    2. afterprint
    3. animationcancel
    4. animationend
    5. animationiteration
    6. beforeprint
    7. beforeunload
    8. blur
    9. copy
    10. cut
    11. DOMContentLoaded
    12. error
    13. focus
    14. hashchange
    15. languagechange
    16. load
    17. message
    18. messageerror
    19. offline
    20. online
    21. orientationchange
    22. pagehide
    23. pageshow
    24. paste
    25. popstate
    26. rejectionhandled
    27. storage
    28. transitioncancel
    29. unhandledrejection
    30. unload
    31. vrdisplayconnect
    32. vrdisplaydisconnect
    33. vrdisplaypresentchange
  6. DOM 相关页面
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. ByteString
    6. CDATASection
    7. CSSPrimitiveValue
    8. CSSValue
    9. CSSValueList
    10. CharacterData
    11. ChildNode
    12. 注释
    13. CustomEvent
    14. DOMConfiguration
    15. DOMError
    16. DOMErrorHandler
    17. DOMException
    18. DOMImplementation
    19. DOMImplementationList
    20. DOMImplementationRegistry
    21. DOMImplementationSource
    22. DOMLocator
    23. DOMObject
    24. DOMParser
    25. DOMPoint
    26. DOMPointInit
    27. DOMPointReadOnly
    28. DOMRect
    29. DOMString
    30. DOMTimeStamp
    31. DOMTokenList
    32. DOMUserData
    33. Document
    34. DocumentFragment
    35. DocumentType
    36. 元素
    37. ElementTraversal
    38. Entity
    39. EntityReference
    40. 事件
    41. EventTarget
    42. HTMLCollection
    43. MutationObserver
    44. 节点
    45. NodeFilter
    46. NodeIterator
    47. NodeList
    48. NonDocumentTypeChildNode
    49. ProcessingInstruction
    50. PromiseResolver
    51. 范围
    52. StaticRange
    53. 文本
    54. TextDecoder
    55. TextEncoder
    56. TimeRanges
    57. TreeWalker
    58. TypeInfo
    59. USVString
    60. UserDataHandler
    61. XMLDocument

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1