Note that properties which are objects (e.g., for overriding the prototype of built-in elements) are listed in a separate section below.
Window.cachesRead only Secure context-
Returns the
CacheStorageobject associated with the current context. This object enables functionality such as storing assets for offline use, and generating custom responses to requests. Window.clientInformationRead only-
An alias for
Window.navigator. Window.closedRead only-
This property indicates whether the current window is closed or not.
Window.cookieStoreRead only Secure context-
Returns a reference to the
CookieStoreobject for the current document context. Window.crashReportRead only Secure context-
Returns a
CrashReportContextobject that enables arbitrary data to be recorded for the current top-level browsing context, which is then added to aCrashReportand sent to a reporting endpoint when a browser crash occurs. Window.credentiallessRead only-
Returns a boolean that indicates whether the current document was loaded inside a credentialless
<iframe>. See IFrame credentialless for more details. Window.crossOriginIsolatedRead only-
Returns a boolean value that indicates whether the website is in a cross-origin isolation state.
Window.cryptoRead only-
Returns the
Cryptoobject associated to the global object. Window.customElementsRead only-
Returns a reference to the
CustomElementRegistryobject, which can be used to register new custom elements and get information about previously registered custom elements. Window.devicePixelRatioRead only-
Returns the ratio between physical pixels and device independent pixels in the current display.
Window.documentRead only-
Returns a reference to the document that the window contains.
Window.documentPictureInPictureRead only Secure context-
Returns a reference to the document Picture-in-Picture window for the current document context.
Window.fenceRead only-
Returns a
Fenceobject instance for the current document context. Available only to documents embedded inside a<fencedframe>. Window.frameElementRead only-
Returns the element in which the window is embedded, or null if the window is not embedded.
Window.framesRead only-
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.historyRead only-
Returns a reference to the history object.
Window.indexedDBRead only-
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an
IDBFactoryobject. Window.innerHeightRead only-
Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
Window.innerWidthRead only-
Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
Window.isSecureContextRead only-
Returns a boolean indicating whether the current context is secure (
true) or not (false). Window.launchQueueRead only-
When a progressive web app (PWA) is launched with a
launch_handlerclient_modevalue offocus-existing,navigate-new, ornavigate-existing, thelaunchQueueprovides access to theLaunchQueueclass, which allows custom launch navigation handling to be implemented for the PWA. Window.lengthRead only-
Returns the number of frames in the window. See also
window.frames. Window.localStorageRead 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.location-
Gets/sets the location, or current URL, of the window object.
Window.locationbarRead only-
Returns the locationbar object.
Window.menubarRead only-
Returns the menubar object.
Window.mozInnerScreenXRead only-
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
mozScreenPixelsPerCSSPixelinnsIDOMWindowUtilsfor a conversion factor to adapt to screen pixels if needed. Window.mozInnerScreenYRead only-
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
mozScreenPixelsPerCSSPixelfor a conversion factor to adapt to screen pixels if needed. Window.name-
Gets/sets the name of the window.
Window.navigationRead only-
Returns the current
window's associatedNavigationobject. The entry point for the Navigation API. Window.navigatorRead only-
Returns a reference to the navigator object.
Window.opener-
Returns a reference to the window that opened this current window.
Window.originRead only-
Returns the global object's origin, serialized as a string.
Window.originAgentClusterRead only-
Returns
trueif this window belongs to an origin-keyed agent cluster. Window.outerHeightRead only-
Gets the height of the outside of the browser window.
Window.outerWidthRead only-
Gets the width of the outside of the browser window.
Window.pageXOffsetRead only-
An alias for
window.scrollX. Window.pageYOffsetRead only-
An alias for
window.scrollY. Window.parentRead only-
Returns a reference to the parent of the current window or subframe.
Window.performanceRead only-
Returns a
Performanceobject, which includes thetimingandnavigationattributes, each of which is an object providing performance-related data. See also Using Navigation Timing for additional information and examples. Window.personalbarRead only-
Returns the personalbar object.
Window.schedulerRead only-
Returns the
Schedulerobject associated with the current context. This is the entry point for using the Prioritized Task Scheduling API. Window.screenRead only-
Returns a reference to the screen object associated with the window.
Window.screenXandWindow.screenLeftRead 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.screenYandWindow.screenTopRead 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.scrollbarsRead only-
Returns the scrollbars object.
Window.scrollMaxXRead only-
The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
Window.scrollMaxYRead only-
The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
Window.scrollXRead only-
Returns the number of pixels that the document has already been scrolled horizontally.
Window.scrollYRead only-
Returns the number of pixels that the document has already been scrolled vertically.
Window.selfRead only-
Returns an object reference to the window object itself.
Window.sessionStorage-
Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
Window.sharedStorageRead only Secure context-
Returns the
WindowSharedStorageobject for the current origin. This is the main entry point for writing data to shared storage using the Shared Storage API. Window.speechSynthesisRead only-
Returns a
SpeechSynthesisobject, which is the entry point into using Web Speech API speech synthesis functionality. Window.statusbarRead only-
Returns the statusbar object.
Window.toolbarRead only-
Returns the toolbar object.
Window.topRead only-
Returns a reference to the topmost window in the window hierarchy. This property is read only.
Window.trustedTypesRead only-
Returns the
TrustedTypePolicyFactoryobject associated with the global object, providing the entry point for using the Trusted Types API. Window.viewportRead only-
Returns a
Viewportobject instance, which provides information about the current state of the device's viewport. Window.visualViewportRead only-
Returns a
VisualViewportobject which represents the visual viewport for a given window. Window.windowRead only-
Returns a reference to the current window.
window[0],window[1], etc.-
Returns a reference to the
windowobject in the frames. SeeWindow.framesfor more details. - Named properties
-
Some elements in the document are also exposed as window properties:
- For each
<embed>,<form>,<iframe>,<img>, and<object>element, itsname(if non-empty) is exposed. For example, if the document contains<form name="my_form">, thenwindow["my_form"](and its equivalentwindow.my_form) returns a reference to that element. - For each HTML element, its
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
HTMLCollectionis returned containing all of them. If any of the elements is a navigable<iframe>or<object>, then thecontentWindowof first such iframe is returned instead. - For each