windows
Взаимодействие с окнами браузера. Вы можете использовать этот API, чтобы получить информацию об открытых окнах, а также открывать, изменять и закрывать окна. Вы также можете обрабатывать события открытия, закрытия окна, и активировать события.
Types
windows.WindowType
(en-US)-
Тип окна браузера.
windows.WindowState
(en-US)-
Состояние окна браузера.
windows.Window
(en-US)-
Информация об окне браузера.
windows.CreateType
-
Specifies the type of browser window to create.
Properties
windows.WINDOW_ID_NONE
(en-US)-
The
windowId
value that represents the absence of a browser window. windows.WINDOW_ID_CURRENT
(en-US)-
The
windowId
value that represents the current window.
Functions
windows.get()
(en-US)-
Gets details about a window, given its ID.
windows.getCurrent()
(en-US)-
Gets the current window.
windows.getLastFocused()
(en-US)-
Gets the window that was most recently focused — typically the window 'on top'.
windows.getAll()
(en-US)-
Gets all windows.
windows.create()
(en-US)-
Creates a new window.
windows.update()
(en-US)-
Updates the properties of a window. Use this to move, resize, and (un)focus a window, etc.
windows.remove()
(en-US)-
Closes a window, and all its tabs.
Events
windows.onCreated
(en-US)-
Fired when a window is created.
windows.onRemoved
(en-US)-
Fired when a window is closed.
windows.onFocusChanged
(en-US)-
Fired when the currently focused window changes.
Browser compatibility
BCD tables only load in the browser
Example extensions
- annotate-page
- bookmark-it
- private-browsing-theme
- store-collected-images
- theme-integrated-sidebar
- window-manipulator
Примечание: Это API основано на API Chromium chrome.windows
. Эта документация основана на windows.json
из кода Chromium.
Информация о совместимости Microsoft Edge предоставлена корпорацией Microsoft и включена здесь под лицензией Creative Commons Attribution 3.0 United States License.