#chrome.windows
Wren's windows (src/page/ext_api.odin, ext_tabs.odin). type "popup" makes the popout window: one tab, no tab strip, no toolbar.
Gate: no permission; contexts: Background, Popup, Tab. Source: api/ext_windows.widl.
#Methods and properties
| Member | Result | Status | Gate | |
getCurrent(optional QueryOptions queryOptions) | Window | host | | The window of the calling page, else the focused one. |
getLastFocused(optional QueryOptions queryOptions) | Window | host | | |
getAll(optional QueryOptions queryOptions) | Window[] | host | | |
get(i64 windowId, optional QueryOptions queryOptions) | Window | host | | -2: the current window. |
create(optional CreateData createData) | Window | host | | |
update(i64 windowId, optional UpdateInfo updateInfo) | Window | host | | focused and the position are applied; the size and the state are not yet. |
remove(i64 windowId) | void | host | | |
#Events
| Event | Listener's parameters | Gate | |
onFocusChanged | i64 windowId | | -1: no window of Wren has the focus. |
onRemoved | i64 windowId | | |
onCreated | Window window | | |
onBoundsChanged | Window window | | |
#Constants
WINDOW_ID_NONE = -1
WINDOW_ID_CURRENT = -2
#Types
#WindowType
A string: "normal", "popup", "panel", "app", "devtools". chrome.windows.WindowType names them.
#CreateType
A string: "normal", "popup", "panel". chrome.windows.CreateType names them.
#WindowState
A string: "normal", "minimized", "maximized", "fullscreen", "locked-fullscreen". chrome.windows.WindowState names them.
#Window
| Property | Type | |
id | i64 | |
focused | bool | |
top | i64 | |
left | i64 | |
width | i64 | |
height | i64 | |
incognito | bool | |
type | WindowType | |
state | WindowState | |
alwaysOnTop | bool | |
tabs (optional) | Tab[] | |
#QueryOptions
| Property | Type | |
populate (optional) | bool | With the window's tabs. |
windowTypes (optional) | WindowType[] | |
#CreateData
| Property | Type | |
url (optional) | UrlOrUrls | |
tabId (optional) | i64 | Not supported: moving a tab into the new window. |
left (optional) | i64 | |
top (optional) | i64 | |
width (optional) | i64 | |
height (optional) | i64 | |
focused (optional) | bool | |
incognito (optional) | bool | true is refused: Wren has no incognito profile. |
type (optional) | CreateType | |
state (optional) | WindowState | |
setSelfAsOpener (optional) | bool | |
#UpdateInfo
| Property | Type | |
left (optional) | i64 | |
top (optional) | i64 | |
width (optional) | i64 | |
height (optional) | i64 | |
focused (optional) | bool | |
drawAttention (optional) | bool | |
state (optional) | WindowState | |
Edit this page on GitHub