A webview displays html content, like an iframe.

Implements

Constructors

Properties

_html: string
_options: WebviewOptions
initData: WebviewInitData
isDisposed: boolean = false
onDidReceiveMessage: Event<any> = ...

Fired when the webview content posts a message.

onMessageEmitter: Emitter<any> = ...
origin?: string
plugin: Plugin
viewId: string
workspace: WorkspaceExtImpl

Accessors

Methods

  • Convert a uri for the local file system to one that can be used inside webviews.

    Webviews cannot directly load resources from the workspace or local file system using file: uris. The asWebviewUri function takes a local file: uri and converts it into a uri that can be used inside of a webview to load the same resource:

    webview.html = `<img src="${webview.asWebviewUri(vscode.Uri.file('/Users/codey/workspace/cat.gif'))}">`
    

    Parameters

    Returns Uri