Skip to main content

Interface: WebviewPanel

A panel that contains a webview.

Properties

active

readonly active: boolean

Whether the panel is active (focused by the user).

Defined in

packages/extension-api/src/extension-api.d.ts:2000


iconPath?

optional iconPath: Uri | { dark: Uri; light: Uri; }

Icon for the panel shown in UI.

Type declaration

Uri

{ dark: Uri; light: Uri; }

dark

readonly dark: Uri

The icon path for the dark theme.

light

readonly light: Uri

The icon path for the light theme.

Defined in

packages/extension-api/src/extension-api.d.ts:1979


onDidChangeViewState

readonly onDidChangeViewState: Event<WebviewPanelOnDidChangeViewStateEvent>

Fired when the panel's view state changes.

Defined in

packages/extension-api/src/extension-api.d.ts:2010


onDidDispose

readonly onDidDispose: Event<void>

Fired when the panel is disposed.

This may be because the user closed the panel or because .dispose() was called on it.

Trying to use the panel after it has been disposed throws an exception.

Defined in

packages/extension-api/src/extension-api.d.ts:2020


title

title: string

Title of the panel shown in UI.

Defined in

packages/extension-api/src/extension-api.d.ts:1974


viewType

readonly viewType: string

Identifies the type of the webview panel.

Defined in

packages/extension-api/src/extension-api.d.ts:1969


visible

readonly visible: boolean

Whether the panel is visible.

Defined in

packages/extension-api/src/extension-api.d.ts:2005


webview

readonly webview: Webview

Webview belonging to the panel.

Defined in

packages/extension-api/src/extension-api.d.ts:1995

Methods

dispose()

dispose(): void

Dispose of the webview panel.

This closes the panel if it showing and disposes of the resources owned by the webview. Webview panels are also disposed when the user closes the webview panel. Both cases fire the onDispose event.

Returns

void

Defined in

packages/extension-api/src/extension-api.d.ts:2035


reveal()

reveal(preserveFocus?): void

Show the webview panel.

Parameters

preserveFocus?

boolean

When true, the webview will not take focus.

Returns

void

Defined in

packages/extension-api/src/extension-api.d.ts:2026