<aside> 🔌 The Webviews API allows you create and load a virtual web page that can be attached to windows.

</aside>

Generic Functions


get

ext.webviews.get(
	webviewId: string,
)

Gets the webview by ID.

PARAMETERS

webviewId: string

The ID of the webview to get.

RETURNS

Promise<ExtWebview>

The promise resolves with the webview object.


query

ext.webviews.query(
	filter?: Partial<ExtWebview>,
)

Queries webviews based on filter.

PARAMETERS

filter?: Partial<ExtWebview>

The filter to apply when querying webviews.

RETURNS

Promise<ExtWebview[]>

The promise resolves with an array of webview objects that match the filter.


create

ext.webviews.create(
	properties?: ExtWebviewProperties,
)

Creates a new webview with specified properties.

PARAMETERS

properties?: ExtWebviewProperties

The properties for the new webview.

RETURNS

Promise<ExtWebview>

The promise resolves with the created webview object.


remove

ext.webviews.remove(
	webviewIds: string | string[],
)

Removes the specified webviews.

PARAMETERS

webviewIds: string | string[]

The IDs of the webviews to remove.

RETURNS

Promise<void>

The promise resolves when the webview are removed.


getCurrent

ext.webviews.getCurrent()

Gets the webview this call is being made from. Only works inside webviews.

PARAMETERS

None.

RETURNS

Promise<ExtWebview>

The promise resolves with the webview that the call is being made from.


Parent window functions


attach

ext.webviews.attach(
	webviewId: string,
	windowId: string,
)

Attaches a webview to a window.

PARAMETERS

webviewId: string

The ID of the webview to attach.

windowId: string

The ID of the window to which the webview will be attached.

RETURNS

Promise<void>

The promise resolves when the webview is updated.


detach

ext.webviews.detach(
	webviewId: string,
)

Detaches a webview from its parent window.

PARAMETERS

webviewId: string

The ID of the webview to detach.

RETURNS

Promise<void>

The promise resolves when the webview is updated.


moveTop

ext.webviews.moveTop(
	webviewId: string,
)

Moves the webview to the top.

PARAMETERS

webviewId: string

The ID of the webview to move.

RETURNS

Promise<void>

The promise resolves when the webview is updated.


getAttachedWindow

ext.webviews.getAttachedWindow(
	webviewId: string,
)

Gets the window attached to the webview.

PARAMETERS

webviewId: string

The ID of the webview.

RETURNS

Promise<ExtWwebviewWindowId | null>

The promise resolves with the parent window id or null if not attached.


setBounds

ext.webviews.setBounds(
	webviewId: string,
	bounds: ExtWebviewRectangle,
)

Sets the bounds of the webview.

PARAMETERS

webviewId: string

The ID of the webview.

bounds: ExtWebviewRectangle

The bounds to set for the webview.

RETURNS

Promise<void>

The promise resolves when the webview is updated.


getBounds

ext.webviews.getBounds(
	webviewId: string,
)

Gets the bounds of the webview.

PARAMETERS

webviewId: string

The ID of the webview.

RETURNS

Promise<ExtWebviewRectangle>


setAutoResize

ext.webviews.setAutoResize(
	webviewId: string,
	options?: ExtWebviewAutoResize,
)

Sets auto resize options for the webview.

PARAMETERS

webviewId: string

options?: ExtWebviewAutoResize

RETURNS