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: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1+Supportedsince Nov 9, 2004
Current: 157Safari
1+Supportedsince Jun 23, 2003
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4+Supportedsince Mar 29, 2011
Current: 157Safari iOS
1+Supportedsince Jun 29, 2007
Current: 27How 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
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (35). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Window | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.blur_event | 5 | 12 | 6 | 5.1 | 18 | 6 | 5 |
| Window.close | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.closed | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.error_event | 10 | 12 | 6 | 5.1 | 18 | 6 | 5 |
| Window.focus | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.focus_event | 5 | 12 | 6 | 5.1 | 18 | 6 | 5 |
| Window.frameElement | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| Window.frames | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.innerHeight | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| Window.innerWidth | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| Window.length | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.load_event | 1 | 12 | 1 | 1.3 | 18 | 4 | 1 |
| Window.moveBy | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.moveTo | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.name | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.open | 1 | 12 | 1 | 1 | 18 | 4 | ✕ |
| Window.open.features_parameter_popup | 98 | 98 | 96 | ✕ | 98 | 96 | ✕ |
| Window.open.once_per_event | 23 | 12 | 65 | 11 | 25 | 65 | ✕ |
| Window.opener | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
Show 15 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Window.outerHeight | 1 | 12 | 1 | 3 | 18 | 4 | 3 |
| Window.outerWidth | 1 | 12 | 1 | 3 | 18 | 4 | 3 |
| Window.parent | 1 | 12 | 1 | 1.3 | 18 | 4 | 1 |
| Window.resizeBy | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.resizeTo | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.resize_event | 1 | 12 | 1 | 1.1 | 18 | 4 | 1 |
| Window.screen | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.screenLeft | 1 | 12 | 64 | 1 | 18 | 64 | 1 |
| Window.screenTop | 1 | 12 | 64 | 1 | 18 | 64 | 1 |
| Window.screenX | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.screenY | 1 | 12 | 1 | 1 | 18 | 4 | 1 |
| Window.self | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| Window.stop | 1 | 14 | 1 | 3 | 18 | 4 | 1 |
| Window.top | 1 | 12 | 1 | 3 | 18 | 4 | 1 |
| Window.window | 1 | 12 | 1 | 3 | 18 | 4 | 1 |