windows

Взаимодействие с окнами браузера. Вы можете использовать этот API, чтобы получить информацию об открытых окнах, а также открывать, изменять и закрывать окна. Вы также можете обрабатывать события открытия, закрытия окна, и активировать события.

Types

windows.WindowType

Тип окна браузера.

windows.WindowState

Состояние окна браузера.

windows.Window

Информация об окне браузера.

windows.CreateType

Specifies the type of browser window to create.

Properties

windows.WINDOW_ID_NONE

The windowId value that represents the absence of a browser window.

windows.WINDOW_ID_CURRENT

The windowId value that represents the current window.

Functions

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.onCreated

Fired when a window is created.

windows.onRemoved

Fired when a window is closed.

windows.onFocusChanged

Fired when the currently focused window changes.

Совместимость с браузерами

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
windows
CreateType
WINDOW_ID_CURRENT
WINDOW_ID_NONE
Window
Window.alwaysOnTop
Window.focused
Window.height
Window.id
Window.incognito
Window.left
Window.sessionId
Window.state
Window.tabs
Window.title
Window.top
Window.type
Window.width
WindowState
WindowState.docked
WindowState.fullscreen
WindowState.maximized
WindowState.minimized
WindowType
WindowType.app
WindowType.devtools
WindowType.panel
create
get
get.getInfo
getInfo.windowTypes
getAll
getAll.populate
getAll.windowTypes
getCurrent
getCurrent.getInfo
getInfo.windowTypes
getLastFocused
getLastFocused.getInfo
getInfo.windowTypes
onBoundsChanged
onCreated
onFocusChanged
onRemoved
remove
update
update.drawAttention
update.focused
update.height
update.left
update.state
update.titlePreface
update.top
update.width

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.
Uses a non-standard name.

Example extensions

Примечание: Этот API основан на Chromium API chrome.windows. Эта документация основана на windows.json из кода Chromium.

Информация о совместимости Microsoft Edge предоставлена корпорацией Microsoft и включена здесь под лицензией Creative Commons Attribution 3.0 United States License.