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.
Window.cookieStore Read only Secure context
-
Returns a reference to the CookieStore object for the current document context.
Window.crashReport Read only Secure context
-
Returns a CrashReportContext object that enables arbitrary data to be recorded for the current top-level browsing context, which is then added to a CrashReport and sent to a reporting endpoint when a browser crash occurs.
Window.credentialless Read only
-
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 Secure context
-
Returns a reference to the document Picture-in-Picture window for the current document context.
Window.fence Read only
-
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
-
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
-
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.location
-
Gets/sets the location, or current URL, of the window object.
Window.locationbar Read only
-
Returns the locationbar object.
Window.menubar Read only
-
Returns the menubar object.
Window.mozInnerScreenX Read 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 mozScreenPixelsPerCSSPixel in nsIDOMWindowUtils for a conversion factor to adapt to screen pixels if needed.
Window.mozInnerScreenY Read 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 mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed.
Window.name
-
Gets/sets the name of the window.
Window.navigation Read only
-
Returns the current window's associated Navigation object. The entry point for the Navigation API.
Window.navigator Read only
-
Returns a reference to the navigator object.
Window.opener
-
Returns 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 window 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 window to the top side of the screen.
Window.scrollbars Read only
-
Returns the scrollbars object.
Window.scrollMaxX Read only
-
The maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
Window.scrollMaxY 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.sessionStorage Read only
-
Returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
Window.sharedStorage Read only Secure context
-
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.viewport Read only
-
Returns a Viewport object instance, which provides information about the current state of the device's viewport.
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.
- Named properties
-
Some elements in the document are also exposed as window properties:
- For each
<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.
- 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 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.