windows.create()

Creates (opens) a new browser with any optional sizing, position or default URL provided.

Syntax

browser.windows.create(
  createData,            // optional object
  function(window) {...} // optional function
)

Parameters

createDataOptional
object.
urlOptional
string or array of string. A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.
tabIdOptional
integer. The id of the tab for which you want to adopt to the new window.
leftOptional
integer. The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
topOptional
integer. The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels.
widthOptional
integer. The width in pixels of the new window, including the frame. If not specified defaults to a natural width.
heightOptional
integer. The height in pixels of the new window, including the frame. If not specified defaults to a natural height.
focusedOptional
boolean. If true, opens an active window. If false, opens an inactive window.
incognitoOptional
boolean. Whether the new window should be an incognito window.
typeOptional
windows.CreateType. Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.
stateOptional
windows.WindowState. The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'.
callbackOptional
function. The function is passed the following arguments:

 

windowOptional
windows.Window. Contains details about the created window.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic supportNo

Examples

Acknowledgements

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

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,