windows
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.
In this article
Types
windows.WindowTypeThe type of browser window this is.
windows.WindowStateThe state of this browser window.
windows.WindowContains information about a browser window.
windows.CreateTypeSpecifies the type of browser window to create.
Constants
windows.WINDOW_ID_NONEThe
windowIdvalue that represents the absence of a browser window.windows.WINDOW_ID_CURRENTA value that can be used in place of a
windowIdin some APIs to represent the current window.
Methods
windows.get()Gets details about a window, given its ID.
windows.getCurrent()Gets the current window.
windows.getLastFocused()Gets the window that was most recently focused — typically the window 'on top'.
windows.getAll()Gets all windows.
windows.create()Creates a new window.
windows.update()Updates the properties of a window. Use this to move, resize, and (un)focus a window, etc.
windows.remove()Closes a window, and all its tabs.
Events
windows.onBoundsChangedFired when a window is resized or moved.
windows.onCreatedFired when a window is created.
windows.onRemovedFired when a window is closed.
windows.onFocusChangedFired when the currently focused window changes.
Example extensions
Browser compatibility
Note:This API is based on Chromium'schrome.windows API. This documentation is derived fromwindows.json in the Chromium code.