This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
The Window interface represents a window containing a DOM document; the document property points to the DOM document loaded in that window.
A window for a given document can be obtained using the document.defaultView property.
A global variable, window, representing the window in which the script is running, is exposed to JavaScript code.
The Window interface is home to a variety of functions, namespaces, objects, and constructors which are not necessarily directly associated with the concept of a user interface window. However, the Window interface is a suitable place to include these items that need to be globally available. Many of these are documented in the JavaScript Reference and the DOM Reference.
In a tabbed browser, each tab is represented by its own Window object; the global window seen by JavaScript code running within a given tab always represents the tab in which the code is running. That said, even in a tabbed browser, some properties and methods still apply to the overall window that contains the tab, such as resizeTo() and innerHeight. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.
This interface inherits properties from the EventTarget interface.
Note that properties which are objects (e.g., for overriding the prototype of built-in elements) are listed in a separate section below.
Window.caches Read only Secure context
Returns the CacheStorage object associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests.
Window.clientInformation Read only
An alias for Window.navigator.
Window.closed Read only
This property indicates whether the current window is closed or not.
Returns a reference to the CookieStore object for the current document context.
Window.credentialless Read only Experimental
Returns a boolean that indicates whether the current document was loaded inside a credentialless <iframe>. See IFrame credentialless for more details.
Window.crossOriginIsolated Read only
Returns a boolean value that indicates whether the website is in a cross-origin isolation state.
Window.crypto Read only
Returns the Crypto object associated to the global object.
Window.customElements Read only
Returns a reference to the CustomElementRegistry object, which can be used to register new custom elements and get information about previously registered custom elements.
Window.devicePixelRatio Read only
Returns the ratio between physical pixels and device independent pixels in the current display.
Window.document Read only
Returns a reference to the document that the window contains.
Window.documentPictureInPicture Read only Experimental Secure context
Returns a reference to the document Picture-in-Picture window for the current document context.
Window.fence Read only Experimental
Returns a Fence object instance for the current document context. Available only to documents embedded inside a <fencedframe>.
Window.frameElement Read only
Returns the element in which the window is embedded, or null if the window is not embedded.
Window.frames Read only
Returns an array of the subframes in the current window.
Window.fullScreen Non-standard
This property indicates whether the window is displayed in full screen or not.
Window.history Read only
Returns a reference to the history object.
Window.indexedDB Read only
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an IDBFactory object.
Window.innerHeight Read only
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
Window.innerWidth Read only
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
Window.isSecureContext Read only
Returns a boolean indicating whether the current context is secure (true) or not (false).
Window.launchQueue Read only Experimental
When a progressive web app (PWA) is launched with a launch_handler client_mode value of focus-existing, navigate-new, or navigate-existing, the launchQueue provides access to the LaunchQueue class, which allows custom launch navigation handling to be implemented for the PWA.
Window.length Read only
Returns the number of frames in the window. See also window.frames.
Window.localStorage Read only
Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
Window.locationGets/sets the location, or current URL, of the window object.
Window.locationbar Read only
Returns the locationbar object.
Returns the menubar object.
Window.mozInnerScreenX Read only Non-standard
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 Read only Non-standard
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.nameGets/sets the name of the window.
Returns the current window's associated Navigation object. The entry point for the Navigation API.
Returns a reference to the navigator object.
Window.openerReturns a reference to the window that opened this current window.
Window.origin Read only
Returns the global object's origin, serialized as a string.
Window.originAgentCluster Read only
Returns true if this window belongs to an origin-keyed agent cluster.
Window.outerHeight Read only
Gets the height of the outside of the browser window.
Window.outerWidth Read only
Gets the width of the outside of the browser window.
Window.pageXOffset Read only
An alias for window.scrollX.
Window.pageYOffset Read only
An alias for window.scrollY.
Window.parent Read only
Returns a reference to the parent of the current window or subframe.
Window.performance Read only
Returns a Performance object, which includes the timing and navigation attributes, each of which is an object providing performance-related data. See also Using Navigation Timing for additional information and examples.
Window.personalbar Read only
Returns the personalbar object.
Window.scheduler Read only
Returns the Scheduler object associated with the current context. This is the entry point for using the Prioritized Task Scheduling API.
Window.screen Read only
Returns a reference to the screen object associated with the window.
Window.screenX and Window.screenLeft Read only
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 Read only
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 Read only
Returns the scrollbars object.
Window.scrollMaxX Non-standard Read only
The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
Window.scrollMaxY Non-standard Read only
The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
Window.scrollX Read only
Returns the number of pixels that the document has already been scrolled horizontally.
Window.scrollY Read only
Returns the number of pixels that the document has already been scrolled vertically.
Window.self Read only
Returns an object reference to the window object itself.
Window.sessionStorageReturns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
Returns the WindowSharedStorage object for the current origin. This is the main entry point for writing data to shared storage using the Shared Storage API.
Window.speechSynthesis Read only
Returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
Window.statusbar Read only
Returns the statusbar object.
Window.toolbar Read only
Returns the toolbar object.
Window.top Read only
Returns a reference to the topmost window in the window hierarchy. This property is read only.
Window.trustedTypes Read only
Returns the TrustedTypePolicyFactory object associated with the global object, providing the entry point for using the Trusted Types API.
Window.visualViewport Read only
Returns a VisualViewport object which represents the visual viewport for a given window.
Window.window Read only
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 for more details.
Some elements in the document are also exposed as window properties:
<embed>, <form>, <iframe>, <img>, and <object> element, its name (if non-empty) is exposed. For example, if the document contains <form name="my_form">, then window["my_form"] (and its equivalent window.my_form) returns a reference to that element.id (if non-empty) is exposed.If a property corresponds to a single element, that element is directly returned. If the property corresponds to multiple elements, then an HTMLCollection is returned containing all of them. If any of the elements is a navigable <iframe> or <object>, then the contentWindow of first such iframe is returned instead.
Window.event Deprecated Read only
Returns the 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.external Deprecated Read only
Returns an object with functions for adding external search providers to the browser.
Window.orientation Deprecated Read only
Returns the orientation in degrees (in 90 degree increments) of the viewport relative to the device's natural orientation.
Window.status Deprecated
Gets/sets the text in the statusbar at the bottom of the browser.
This interface inherits methods from the EventTarget interface.
Window.atob()Decodes a string of data which has been encoded using base-64 encoding.
Window.alert()Displays an alert dialog.
Window.blur() Deprecated
Sets focus away from the window.
Window.btoa()Creates a base-64 encoded ASCII string from a string of binary data.
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.clearInterval()Cancels the repeated execution set using Window.setInterval().
Window.clearTimeout()Cancels the delayed execution set using Window.setTimeout().
Window.close()Closes the current window.
Window.confirm()Displays a dialog with a message that the user needs to respond to.
Window.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.
Window.dump() Non-standard
Writes a message to the console.
Window.fetch()Starts the process of fetching a resource from the network.
Window.fetchLater() Experimental
Creates a deferred fetch, which is sent once the page is navigated away from (it is destroyed or enters the bfcache), or after a provided activateAfter timeout — whichever comes first.
Window.find() Non-standard
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() Non-standard
Gets default computed style for the specified element, ignoring author stylesheets.
Window.getScreenDetails() Experimental Secure context
Returns a Promise that fulfills with a ScreenDetails object instance representing the details of all the screens available to the user's device.
Window.getSelection()Returns the selection object representing the selected item(s).
Window.matchMedia()Returns a MediaQueryList object representing the specified media query string.
Window.moveBy()Moves the current window by a specified amount.
Window.moveTo()Moves the window to the specified coordinates.
Window.open()Opens a new window.
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.queryLocalFonts() Experimental Secure context
Returns a Promise that fulfills with an array of FontData objects representing the font faces available locally.
Window.queueMicrotask()Queues a microtask to be executed at a safe time prior to control returning to the browser's event loop.
Window.reportError()Reports an error in a script, emulating an unhandled exception.
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() Non-standard
Scrolls the document by the given number of lines.
Window.scrollByPages() Non-standard
Scrolls the current document by the specified number of pages.
Window.scrollTo()Scrolls to a particular set of coordinates in the document.
Window.setInterval()Schedules a function to execute every time a given number of milliseconds elapses.
Window.setTimeout()Schedules a function to execute in a given amount of time.
Window.showDirectoryPicker() Experimental Secure context
Displays a directory picker which allows the user to select a directory.
Window.showOpenFilePicker() Experimental Secure context
Shows a file picker that allows a user to select a file or multiple files.
Window.showSaveFilePicker() Experimental Secure context
Shows a file picker that allows a user to save a file.
Window.sizeToContent() Non-standard
Sizes the window according to its content.
Window.stop()This method stops window loading.
Window.structuredClone()Creates a deep clone of a given value using the structured clone algorithm.
Window.captureEvents() Deprecated
Registers the window to capture all events of the specified type.
Window.clearImmediate() Non-standard Deprecated
Cancels the repeated execution set using setImmediate().
Window.releaseEvents() Deprecated
Releases the window from trapping events of a specific type.
Window.requestFileSystem() Non-standard Deprecated
Lets a website or app gain access to a sandboxed file system for its own use.
Window.setImmediate() Non-standard Deprecated
Executes a function after the browser has finished other heavy tasks.
Window.setResizable() Non-standard Deprecated
Does nothing (no-op). Kept for backward compatibility with Netscape 4.x.
Window.webkitConvertPointFromNodeToPage() Non-standard Deprecated
Transforms a WebKitPoint from the node's coordinate system to the page's coordinate system.
Window.webkitConvertPointFromPageToNode() Non-standard Deprecated
Transforms a WebKitPoint from the page's coordinate system to the node's coordinate system.
Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface. In addition to the events listed below, many events can bubble from the Document contained in the window object.
errorFired 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.
languagechangeFired at the global scope object when the user's preferred language changes.
resizeFired when the window has been resized.
storageFired when a storage area (localStorage or sessionStorage) has been modified in the context of another document.
offlineFired when the browser has lost access to the network and the value of navigator.onLine has switched to false.
onlineFired when the browser has gained access to the network and the value of navigator.onLine has switched to true.
devicemotion Secure context
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 Secure context
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.
deviceorientationabsolute Secure context
Fired when fresh data is available from the magnetometer orientation sensor about the current absolute orientation of the device as compared to the Earth coordinate frame.
gamepadconnectedFired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used.
gamepaddisconnectedFired when the browser detects that a gamepad has been disconnected.
hashchangeFired when the fragment identifier of the URL has changed (the part of the URL beginning with and following the # symbol).
pagehideSent 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.
pagerevealFired when a document is first rendered, either when loading a fresh document from the network or activating a document (either from back/forward cache (bfcache) or prerender).
pageshowSent 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.
pageswapFired when a document is about to be unloaded due to a navigation.
popstateFired when the active history entry changes.
beforeunloadFired when the window, the document and its resources are about to be unloaded.
loadFired when the whole page has loaded, including all dependent resources such as stylesheets images.
unload Deprecated
Fired when the document or a child resource is being unloaded.
appinstalledFired when the browser has successfully installed a page as an application.
beforeinstallpromptFired when a user is about to be prompted to install a web application.
messageFired when the window receives a message, for example from a call to Window.postMessage() from another browsing context.
messageerrorFired when a Window object receives a message that can't be deserialized.
afterprintFired after the associated document has started printing or the print preview has been closed.
beforeprintFired when the associated document is about to be printed or previewed for printing.
rejectionhandledSent every time a JavaScript Promise is rejected, regardless of whether or not there is a handler in place to catch the rejection.
unhandledrejectionSent when a JavaScript Promise is rejected but there is no handler in place to catch the rejection.
scrollsnapchange Experimental
Fired on the scroll container at the end of a scrolling operation when a new scroll snap target has been selected.
scrollsnapchanging Experimental
Fired on the scroll container when the browser determines a new scroll snap target is pending, i.e., it will be selected when the current scroll gesture ends.
orientationchange Deprecated
Fired when the orientation of the device has changed.
vrdisplayactivate Deprecated Non-standard
Fired when a display is able to be presented to.
vrdisplayconnect Deprecated Non-standard
Fired when a compatible VR device has been connected to the computer.
vrdisplaydisconnect Deprecated Non-standard
Fired when a compatible VR device has been disconnected from the computer.
vrdisplaydeactivate Deprecated Non-standard
Fired when a display can no longer be presented to.
vrdisplaypresentchange Deprecated Non-standard
Fired when the presenting state of a VR device changes — i.e., goes from presenting to not presenting, or vice versa.
Not all events that bubble can reach the Window object. Only the following do and can be listened for on the Window object:
abortauxclickbeforeinputbeforematchbeforetogglecancelcanplaycanplaythroughchangeclickclosecontextlostcontextmenucontextrestoredcopycuechangecutdblclickdragdragenddragenterdragleavedragoverdragstartdropdurationchangeemptiedendedformdatainputinvalidkeydownkeypresskeyuploadeddataloadedmetadataloadstartmousedownmouseentermouseleavemousemovemouseoutmouseovermouseuppastepauseplayplayingprogressratechangeresetscrollendsecuritypolicyviolationseekedseekingselectslotchangestalledsubmitsuspendtimeupdatetogglevolumechangewaitingwheelSee DOM Reference.
HTML elements have three ways to listen for events:
EventTarget.addEventListener method.oneventname property in JavaScript.on-prefixed attribute to the element in the HTML.To listen for events on Window objects, in general, you can only use the first two methods, because Window has no corresponding HTML element. However, there's a specific group of events whose listeners can be added to the <body> (or the deprecated <frameset>) element that's owned by the Window's document, using the second or third methods. These events are:
afterprintbeforeprintbeforeunloadblurerrorfocushashchangelanguagechangeloadmessagemessageerrorofflineonlinepagehidepagerevealpageshowpageswappopstaterejectionhandledresizescrollstorageunhandledrejectionunloadThis means the following are strictly equivalent:
window.onresize = (e) => console.log(e.currentTarget); document.body.onresize = (e) => console.log(e.currentTarget);
<body onresize="console.log(event.currentTarget)"></body>
In all three cases, you see the Window object logged as currentTarget.
| Specification |
|---|
| HTML> # the-window-object> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
DOMContentLoaded_event |
1 | 12 | 1 | 9 | 3.1 | 18 | 4 | 10.1 | 2 | 1.0 | 4.4 | 2 |
Window |
1 | 12 | 1 | 3 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 1 | 1 |
afterprint_event |
63 | 12 | 6 | 50 | 13 | 63 | 6 | 46 | 13 | 8.0 | 63 | 13 |
alert |
1Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
12 | 1 | 3Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 | 18Starting with Chrome Android 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
4 | 10.1Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 | 1.0Starting with Samsung Internet 5.0, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
4.4Starting with WebView Android 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 |
appinstalled_event |
64 | 79 | No | NoOpera exposes theonappinstalled event handler, but the event is never fired. |
No | 57 | No | NoOpera exposes theonappinstalled event handler, but the event is never fired. |
No | 7.0 | 57 | No |
beforeinstallprompt_event |
6144–61Theonbeforeinstallprompt event handler property is not supported. |
79 | No | 4831–48Theonbeforeinstallprompt event handler property is not supported. |
No | 6144–61Theonbeforeinstallprompt event handler property is not supported. |
No | 4532–45Theonbeforeinstallprompt event handler property is not supported. |
No | 8.05.0–8.0Theonbeforeinstallprompt event handler property is not supported. |
6144–61Theonbeforeinstallprompt event handler property is not supported. |
No |
beforeprint_event |
63 | 12 | 6 | 50 | 13 | 63 | 6 | 46 | 13 | 8.0 | 63 | 13 |
beforeunload_event |
1 | 12 | 1 | 12 | 3 | 18 | 4 | 12 | No | 1.0 | 4.4 | No |
blur |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
blur_event |
5 | 12 | 6["Apart from firing the event onwindow as other browsers do, Firefox also fires the event on the document object. See bug 1228802.", "Before Firefox 24, the interface for this event is a plain Event, not FocusEvent."] |
≤12.1 | 5.1 | 18 | 6["Apart from firing the event onwindow as other browsers do, Firefox for Android also fires the event on the document object. See bug 1228802.", "Before Firefox for Android 24, the interface for this event is a plain Event, not FocusEvent."] |
≤12.1 | 5 | 1.0 | 4.4 | 5 |
cancelAnimationFrame |
24 | 12 | 2311–23 | 15 | 76–7 | 25 | 2314–23 | 14 | 76–7 | 1.5 | 4.4 | 76–7 |
cancelIdleCallback |
47 | 79 | 55 | 34 | No | 47 | 55 | 34 | No | 5.0 | 47 | No |
captureEvents |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
clearImmediate |
No | 12–79 | No | No | No | No | No | No | No | No | No | No |
close |
1 | 12Before Edge 79, scripts can close windows that weren't opened by the same script. |
1Before Firefox 46, scripts can close windows that weren't opened by the same script. |
3 | 1 | 18 | 4Before Firefox for Android 46, scripts can close windows that weren't opened by the same script. |
10.1 | 1 | 1.0 | 4.4 | 1 |
closed |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
confirm |
1Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
12 | 1 | 3Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 | 18Starting with Chrome Android 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
4 | 10.1Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 | 1.0Starting with Samsung Internet 5.0, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 |
cookieStore |
87 | 87 | 140 | 73 | 18.4 | 87 | 140 | 62 | 18.4 | 14.0 | 87 | 18.4 |
credentialless |
110 | 110 | No | 96 | No | 110 | No | 74 | No | 21.0 | 110 | No |
customElements |
54 | 79 | 63 | 41 | 10.1 | 54 | 63 | 41 | 10.3 | 6.0 | 54 | 10.3 |
devicePixelRatio |
1 | 12 | 18 | 11.1 | 18 | 18 | 11.1 | 1.0 | 4.4 | |||
devicemotion_event |
31 | 12 | 6 | 18 | 17 | 31 | 6 | 18 | 4.2 | 2.0 | 4.4.3 | 4.2 |
deviceorientation_event |
7 | 12 | 63.6–6 | 12 | 17 | 18 | 64–6 | 12 | 4.2 | 1.0 | 3 | 4.2 |
deviceorientationabsolute_event |
50 | 79 | 110 | 37 | No | 50 | 110 | 37 | No | 5.0 | 50 | No |
document |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
documentPictureInPicture |
116 | 116 | No | 102 | No | No | No | No | No | No | No | No |
dump |
No | No |
1.5By default, this method exists and can be called, but does nothing unless enabled in the browser's preferences. |
No | No | No | 4This method exists but has no effect. |
No | No | No | No | No |
error_event |
10 | 12 | 6 | 15 | 5.1 | 18 | 6 | 14 | 5 | 1.0 | 4.4 | 5 |
event |
1 | 12 | 66 | 7 | 1.1 | 18 | 66 | 10.1 | 1 | 1.0 | 4.4 | 1 |
external |
1 | 12 |
2From Firefox 78AddSearchProvider() does nothing, as the specification requires. |
15 | No | 18 |
4From Firefox for Android 79AddSearchProvider() does nothing, as the specification requires. |
14 | No | 1.0 | 4.4.3 | No |
fence |
126 | 126 | No | 112 | No | 126 | No | 83 | No | 28.0 | No | No |
fetchLater |
135 | 135 | No | 120 | No | 135 | No | 89 | No | No | 135 | No |
find |
1 | 79 | 1 | 15 | 3 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
focus |
1Starting in Chrome 66, opening a popup in fullscreen mode and calling this function will end fullscreen mode. |
12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
focus_event |
5 | 12 | 6["Apart from firing the event onwindow as other browsers do, Firefox also fires the event on the document object. See bug 1228802.", "Before Firefox 24, the interface for this event is a plain Event, not FocusEvent."] |
≤12.1 | 5.1 | 18 | 6["Apart from firing the event onwindow as other browsers do, Firefox for Android also fires the event on the document object. See bug 1228802.", "Before Firefox for Android 24, the interface for this event is a plain Event, not FocusEvent."] |
≤12.1 | 5 | 1.0 | 4.4 | 5 |
frameElement |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
frames |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
fullScreen |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
gamepadconnected_event |
89 | 16 | 89 | 16 | 16 | |||||||
gamepaddisconnected_event |
89 | 16 | 89 | 16 | 16 | |||||||
getComputedStyle |
1 | 12 | 1Before version 62 this function returnednull 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). |
7.2 | 3 | 18 | 4Before version 62 this function returnednull 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). |
10.1 | 1 | 1.0 | 4.4 | 1 |
getDefaultComputedStyle |
No | No | 19 | No | No | No | 19 | No | No | No | No | No |
getDigitalGoodsService |
No | 134 | No | No | No | 101 | No | 70 | No | 19.0 | No | No |
getScreenDetails |
100 | 100 | No | 86 | No | 100 | No | 69 | No | 19.0 | 100 | No |
getSelection |
1 | 12 | 1 | 9 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
hashchange_event |
84–8A regularEvent object is fired, rather than a HashChangeEvent object. |
12 | 3.6 | 10.6 | 5 | 18 | 4 | 11 | 5 | 1.0 | 4.4 | 5 |
history |
1 | 12 | 1 | 3 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
innerHeight |
1 | 12 | 1From version 4 to 24, this property could give a wrong value before page load in certain circumstances (see bug 641188). |
9 | 3 | 18 | 4Before version 24, this property could give a wrong value before page load in certain circumstances (see bug 641188). |
10.1 | 1This property returns the height of the visual viewport instead of the layout viewport. See bug 174362 for details. |
1.0 | 4.4 | 1This property returns the height of the visual viewport instead of the layout viewport. See bug 174362 for details. |
innerWidth |
1 | 12 | 1From version 4 to 24, this property could give a wrong value before page load in certain circumstances (see bug 641188). |
9 | 3 | 18 | 4Before version 24, this property could give a wrong value before page load in certain circumstances (see bug 641188). |
10.1 | 1This property returns the width of the visual viewport instead of the layout viewport. See bug 174362 for details. |
1.0 | 4.4 | 1This property returns the width of the visual viewport instead of the layout viewport. See bug 174362 for details. |
languagechange_event |
37 | 79 | 32 | 24 | 10.1 | 37 | 4 | 24 | 10.3 | 4.0 | 37 | 10.3 |
launchQueue |
102 | 102 | No | 88 | No | No | No | No | No | No | No | No |
length |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
load_event |
1 | 12 | 1 | 4 | 1.3 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
localStorage |
4 | 12 | 3.5 | 10.5 | 4 | 18 | 4 | 11 | 3.2 | 1.0 | 4.4 | 3.2 |
location |
1 | 12 | 1Before Firefox 57, single quotes contained in URLs were escaped when accessed via URL APIs. See bug 1386683. |
3 | 1 | 18 | 4Before Firefox for Android 57, single quotes contained in URLs were escaped when accessed via URL APIs. See bug 1386683. |
10.1 | 1 | 1.0 | 4.4 | 1 |
locationbar |
1 | 12 | 1 | 15 | 3 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
matchMedia |
9 | 12 | 6 | 12.1 | 5.1 | 18 | 6 | 12.1 | 5 | 1.0 | 3 | 5 |
menubar |
1 | 12 | 1 | 15 | 3 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
message_event |
60 | 12 | 9 | 47 | 4 | 60 | 9 | 47 | 4 | 8.0 | 60 | 4 |
messageerror_event |
60 | 18 | 57 | 47 | 16.4 | 60 | 57 | 47 | 16.4 | 8.0 | 60 | 16.4 |
moveBy |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
moveTo |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
mozInnerScreenX |
No | No | 3.6 | No | No | No | 4 | No | No | No | No | No |
mozInnerScreenY |
No | No | 3.6 | No | No | No | 4 | No | No | No | No | No |
name |
1 | 12 | 1Before Firefox 86, if a new page from another domain is loaded into a tab, thenwindow.name is not set to an empty string, which can allow some cross-site attacks. See bug 1685089 and bug 444222. |
≤12.1 | 1 | 18 | 4Before Firefox for Android 86, if a new page from another domain is loaded into a tab, thenwindow.name is not set to an empty string, which can allow some cross-site attacks. See bug 1685089 and bug 444222. |
≤12.1 | 1 | 1.0 | 4.4 | 1 |
navigation |
102 | 102 | No | 88 | No | 102 | No | 70 | No | 19.0 | 102 | No |
navigator |
11 | 1212 | 191 | 315 | 11 | 1818 | 491 | 10.114 | 11 | 1.01.0 | 4.44.4 | 11 |
offline_event |
3 | 12 | 9 | 15 | 4 | 18 | 9 | 14 | 3 | 1.0 | 4.4 | 3 |
online_event |
3 | 12 | 9 | 15 | 4 | 18 | 9 | 14 | 3 | 1.0 | 4.4 | 3 |
open |
1 | 12 | 1 | 3 | 1 | 18 | 4 | 10.1 | 1This method will not function if thetarget parameter is unspecified or set to _blank. |
1.0 | 4.4 | 1This method will not function if thetarget parameter is unspecified or set to _blank. |
opener |
1 | 12 | 1 | 3 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
orientation |
No | No | No | No | No | 18 | 44 | ≤14 | ≤3 | 1.0 | 4.4 | ≤3 |
orientationchange_event |
No | No | No | No | No | 18 | 44 | ≤14 | ≤3 | 1.0 | 4.4 | ≤3 |
originAgentCluster |
90 | 90 | 138 | 76 | No | 90 | 138 | 64 | No | 15.0 | 90 | No |
outerHeight |
1 | 12 | 1 | 9 | 3 | 18 | 4 | 10.1 | 3 | 1.0 | 4.4 | 3 |
outerWidth |
1 | 12 | 1 | 9 | 3 | 18 | 4 | 10.1 | 3 | 1.0 | 4.4 | 3 |
pagehide_event |
3 | 12 | 6 | 15 | 5 | 18 | 6 | 14 | 4.2 | 1.0 | 4.4 | 4.2 |
pagereveal_event |
123 | 123 | No | 109 | 18.2 | 123 | No | 82 | 18.2 | 27.0 | 123 | 18.2 |
pageshow_event |
3 | 12 | 6 | 15 | 5 | 18 | 6 | 14 | 4.2 | 1.0 | 4.4 | 4.2 |
pageswap_event |
124 | 124 | No | 110 | 18.2 | 124 | No | 82 | 18.2 | 27.0 | 124 | 18.2 |
parent |
1 | 12 | 1 | 3 | 1.3 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
personalbar |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
popstate_event |
5Before version 34, Chrome would fire apopstate event on page load. |
12 | 4 | 11.5 | 5Before version 10, Safari would fire apopstate event on page load. |
18Before version 34, Chrome Android would fire apopstate event on page load. |
4 | 11.5 | 4.2Before version 10, Safari on iOS would fire apopstate event on page load. |
1.0Before version 2.0, Samsung Internet would fire apopstate event on page load. |
4.4Before version 37, WebView Android would fire apopstate event on page load. |
4.2Before version 10, WebView on iOS would fire apopstate event on page load. |
postMessage |
2 | 12 | 3["Firefox 8 and up supports sendingFile and FileList objects between windows. This is only allowed if the recipient's principal is contained within the sender's principal for security reasons.", "Before Firefox 6, the message parameter must be a string. Since Firefox 6, the 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."] |
9.5 | 4 | 18 | 4["Firefox for Android 8 and up supports sendingFile and FileList objects between windows. This is only allowed if the recipient's principal is contained within the sender's principal for security reasons.", "Before Firefox for Android 6, the message parameter must be a string. Since Firefox for Android 6, the 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."] |
10.1 | 3.2 | 1.0 | 4.4 | 3.2 |
print |
1Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
12 | 1 | 6Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1.1 | 18Starting with Chrome Android 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
114 | 10.1Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 | 1.0Starting with Samsung Internet 5.0, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
4.4Starting with WebView Android 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 |
prompt |
1Starting with Chrome 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
12 | 1Firefox strips newline characters from the prompt response; see bug 1716229. |
3Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 | 18Starting with Chrome Android 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
4Firefox for Android strips newline characters from the prompt response; see bug 1716229. |
10.1Starting with Opera 33, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 | 1.0Starting with Samsung Internet 5.0, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
4.4Starting with WebView Android 46, this method is blocked inside an<iframe> unless its sandbox attribute has the value allow-modals. |
1 |
queryLocalFonts |
103 | 103 | No | 89 | No | No | No | No | No | No | No | No |
rejectionhandled_event |
49 | 79 | 69 | 36 | 11 | 49 | 79 | 36 | 11.3 | 5.0 | 49 | 11.3 |
releaseEvents |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
requestAnimationFrame |
2410 | 12Before version 17, Edge does not reliably firerequestAnimationFrame before the paint cycle. |
23Callback parameter is aDOMHighResTimestamp. This means ten microsecond precision and zero time as performance.now().11–42Callback parameter is aDOMTimestamp. This means millisecond precision and zero time as Date.now().4–11Could be called with no input parameters. |
1515 | 76 | 2518 | 2314–42 | 1414 | 76 | 1.51.0 | 4.44.4 | 76 |
requestFileSystem |
13 | 79 | No | No | 6–8 | 18 | No | No | 6–8 | 1.0 | 37 | 6–8 |
requestIdleCallback |
47 | 79 | 55 | 34 | No | 47 | 55 | 34 | No | 5.0 | 47 | No |
resizeBy |
1 | 12 | 1Since 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 bywindow.open or contains more than one tab. See here for more details. |
≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
resizeTo |
1 | 12 | 1Since 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 bywindow.open or contains more than one tab. See here for more details. |
≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
resize_event |
1Chrome does not fire aresize event on page load. |
12Before Edge 79, Edge fired aresize event on page load. This is no longer the case. |
1Before Firefox 68, Firefox fired aresize event on page load. This is no longer the case. |
7Opera does not fire aresize event on page load. |
1.1 | 18Chrome Android does not fire aresize event on page load. |
4Before Firefox for Android 68, Firefox for Android fired aresize event on page load. This is no longer the case. |
10.1Opera does not fire aresize event on page load. |
1 | 1.0Samsung Internet does not fire aresize event on page load. |
1WebView does not fire aresize event on page load. |
1 |
resolveLocalFileSystemURL |
13 | 79 | No | No | No | 18 | No | No | No | 1.0 | 4.4 | No |
screen |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
screenLeft |
1 | 12 | 64 | ≤12.1 | 1 | 18 | 64 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
screenTop |
1 | 12 | 64 | ≤12.1 | 1 | 18 | 64 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
screenX |
1 | 12 | 1Before Firefox 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value ofscreenPixelsPerCSSPixel of 1 for any device. |
≤12.1 | 1 | 18 | 4Before Firefox for Android 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value ofscreenPixelsPerCSSPixel of 1 for any device. |
≤12.1 | 1 | 1.0 | 4.4 | 1 |
screenY |
1 | 12 | 1Before Firefox 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value ofscreenPixelsPerCSSPixel of 1 for any device. |
≤12.1 | 1 | 18 | 4Before Firefox for Android 28, Gecko was using device pixels instead of CSS pixels; in other words, it was assuming a value ofscreenPixelsPerCSSPixel of 1 for any device. |
≤12.1 | 1 | 1.0 | 4.4 | 1 |
scroll |
1 | 12 | 1 | 3 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
scrollBy |
1 | 12 | 1 | 3 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
scrollByLines |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
scrollByPages |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
scrollMaxX |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
scrollMaxY |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
scrollTo |
1 | 12 | 1 | 4 | 1 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
scrollX |
11 | 1212 | 11 | 9.64 | 11 | 1818 | 44 | 10.110.1 | 11 | 1.01.0 | 4.44.4 | 11 |
scrollY |
11 | 1212 | 11 | 9.64 | 11 | 1818 | 44 | 10.110.1 | 11 | 1.01.0 | 4.44.4 | 11 |
scrollbars |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
scrollsnapchange_event |
129 | 129 | No | 115 | No | 129 | No | 86 | No | 28.0 | 129 | No |
scrollsnapchanging_event |
129 | 129 | No | 115 | No | 129 | No | 86 | No | 28.0 | 129 | No |
self |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
sessionStorage |
4 | 12 | 2 | 10.5 | 4 | 18 | 4 | 11 | 3.2 | 1.0 | 4.4 | 3.2 |
setImmediate |
No | 12–79 | No | No | No | No | No | No | No | No | No | No |
setResizable |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
sharedStorage |
126 | 126 | No | 112 | No | 126 | No | 83 | No | 28.0 | 126 | No |
showDirectoryPicker |
86 | 86 | No | 72 | No | 132 | No | 87 | No | No | 132 | No |
showOpenFilePicker |
86 | 86 | No | 72 | No | 132 | No | 87 | No | No | 132 | No |
showSaveFilePicker |
86 | 86 | No | 72 | No | 132 | No | 87 | No | No | 132 | No |
sizeToContent |
No | No | 1–120 | No | No | No | 4–120This method has no effect as a page is always in a tab. |
No | No | No | No | No |
speechSynthesis |
33 | 14 | 49 | 20 | 7 | 33 | 62 | No | 7 | 2.0 | No | 7 |
status |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
statusbar |
1 | 12 | 1 | 15 | 3 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
stop |
1 | 14 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
storage_event |
1 | 15 | 45 | 15 | 4 | 18 | 45 | 14 | 4 | 1.0 | 4.4 | 4 |
styleMedia |
6 | 12 | No | 15 | 5 | 18 | No | 14 | 4 | 1.0 | 4.4 | 4 |
toolbar |
1 | 12 | 1 | 15 | 3 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
top |
1 | 12 | 1Starting in Firefox 6, this property is read only, as defined by the standard. |
≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
unhandledrejection_event |
49 | 79 | 69event.preventDefault() does not prevent Firefox from logging the error message in the console, see bug 1642147. |
36 | 11 | 49 | 79event.preventDefault() does not prevent Firefox for Android from logging the error message in the console, see bug 1642147. |
36 | 11.3 | 5.0 | 49 | 11.3 |
unload_event |
1 | 12 | 1 | 4 | 3 | 18 | 4 | 10.1 | 1 | 1.0 | 4.4 | 1 |
updateCommands |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
viewport |
138 | 138 | No | 122 | No | 138 | No | 91 | No | No | 138 | No |
visualViewport |
61 | 79 | 91 | 48 | 13 | 61 | 68 | 45 | 13 | 8.0 | 61 | 13 |
vrdisplayactivate_event |
No | 15–79 | 9864–98Only on macOS and Windows.55–64Only on Windows. |
No | No | No | 55–98 | No | No | No | No | No |
vrdisplayconnect_event |
No | 15–79 | 9864–98Only on macOS and Windows.55–64Only on Windows. |
No | No | No | 55–98 | No | No | 6.0–13.0Supported on Samsung Internet for GearVR. |
No | No |
vrdisplaydeactivate_event |
No | 15–79 | 9864–98Only on macOS and Windows.55–64Only on Windows. |
No | No | No | 55–98 | No | No | No | No | No |
vrdisplaydisconnect_event |
No | 15–79 | 9864–98Only on macOS and Windows.55–64Only on Windows. |
No | No | 56–80["Chrome for Android 56 supports only Google Daydream View.", "Chrome for Android 57 adds support for Google Cardboard."] |
55–98 | No | No | 6.0–13.0Supported on Samsung Internet for GearVR. |
No | No |
vrdisplaypresentchange_event |
No | 15–79 | 9864–98Only on macOS and Windows.55–64Only on Windows. |
No | No | 56–80["Chrome for Android 56 supports only Google Daydream View.", "Chrome for Android 57 adds support for Google Cardboard."] |
55–98 | No | No | 6.0–13.0Supported on Samsung Internet for GearVR. |
No | No |
webkitConvertPointFromNodeToPage |
1–39 | 12–79 | No | 15–26 | 4 | 18–39 | No | 14–26 | 3 | 1.0–4.0 | 4.4–39 | 3 |
webkitConvertPointFromPageToNode |
1–39 | 12–79 | No | 15–26 | 4 | 18–39 | No | 14–26 | 3 | 1.0–4.0 | 4.4–39 | 3 |
window |
1 | 12 | 1 | ≤12.1 | 3 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Window