Windows

Use the chrome.windows module to interact with browser windows. You can use this module to create, modify, and rearrange windows in the browser.

Manifest

You must declare the "tabs" permission in your extension's manifest to use the windows API. (No, that isn't a typo — the window and tabs modules interact so closely we decided to just share one permission between them.) For example:

{
  "name": "My extension that uses windows",
  "version": "0.1",
  "permissions": [
    "tabs"
  ]
}

The current window

Many functions in the extension system take an optional windowId parameter which is documented to default to the "current window".

The current window is the window that contains the code that is currently executing. It's important to realize that this can be different from the topmost or focused window.

For example, consider code running in a toolstrip, that calls chrome.tabs.getSelected. The current window is the window that contains the toolstrip that made the call, no matter what the topmost window is.

In the case of the background page, the value of the current window falls back to the topmost window.