coderef

WindowBaseline · Widely available

The window global object represents a browser tab or iframe and its relationship to the document and other tabs. It's also a generic global object, under which many other APIs are located.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.

Browser support

DesktopChrome
1+Supportedsince Dec 11, 2008
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1+Supportedsince Nov 9, 2004
Current: 157
Safari
1+Supportedsince Jun 23, 2003
Current: 27
MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155
Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157
Safari iOS
1+Supportedsince Jun 29, 2007
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Window.

Feature detection

JS · check before using
if ("Window" in globalThis) {
  // Window is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (35). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Window112111841
Window.blur_event51265.11865
Window.close112111841
Window.closed112111841
Window.error_event101265.11865
Window.focus112111841
Window.focus_event51265.11865
Window.frameElement112131841
Window.frames112111841
Window.innerHeight112131841
Window.innerWidth112131841
Window.length112111841
Window.load_event11211.31841
Window.moveBy112111841
Window.moveTo112111841
Window.name112111841
Window.open11211184✕
Window.open.features_parameter_popup989896✕9896✕
Window.open.once_per_event231265112565✕
Window.opener112111841
Show 15 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Window.outerHeight112131843
Window.outerWidth112131843
Window.parent11211.31841
Window.resizeBy112111841
Window.resizeTo112111841
Window.resize_event11211.11841
Window.screen112111841
Window.screenLeft11264118641
Window.screenTop11264118641
Window.screenX112111841
Window.screenY112111841
Window.self112131841
Window.stop114131841
Window.top112131841
Window.window112131841