windows.update()

Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.

Syntax

browser.windows.update(
  windowId,              // integer
  updateInfo,            // object
  function(window) {...} // optional function
)

Parameters

windowId
integer.
updateInfo
object.
leftOptional
integer. The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels.
topOptional
integer. The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels.
widthOptional
integer. The width to resize the window to in pixels. This value is ignored for panels.
heightOptional
integer. The height to resize the window to in pixels. This value is ignored for panels.
focusedOptional
boolean. If true, brings the window to the front. If false, brings the next window in the z-order to the front.
drawAttentionOptional
boolean. If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request.
stateOptional
windows.WindowState. The new 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:
window
windows.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,