Interact with browser windows. You can use this API to get information about open windows and to open, modify, and close windows. You can also listen for window open, close, and activate events.


windows.WindowType (en-US)
The type of browser window this is.
windows.WindowState (en-US)
The state of this browser window.
windows.Window (en-US)
Contains information about a browser window.
Specifies the type of browser window to create.


windows.WINDOW_ID_NONE (en-US)
The windowId value that represents the absence of a browser window.
The windowId value that represents the current window.


windows.get() (en-US)
Gets details about a window, given its ID.
windows.getCurrent() (en-US)
Gets the current window.
windows.getLastFocused() (en-US)
Gets the window that was most recently focused — typically the window 'on top'.
windows.getAll() (en-US)
Gets all windows.
windows.create() (en-US)

Creates a new window.

windows.update() (en-US)
Updates the properties of a window. Use this to move, resize, and (un)focus a window, etc.
windows.remove() (en-US)
Closes a window, and all its tabs.


windows.onCreated (en-US)
Fired when a window is created.
windows.onRemoved (en-US)
Fired when a window is closed.
windows.onFocusChanged (en-US)
Fired when the currently focused window changes.

Browser compatibility

BCD tables only load in the browser

Edge incompatibilities

Promises are not supported in Edge. Use callbacks instead.

Example extensions


This API is based on Chromium's API. This documentation is derived from windows.json in the Chromium code.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.