Files
vscode-extension-samples/webview-sample
2021-07-13 18:48:28 -07:00
..
2020-05-29 14:20:07 -07:00
2021-06-22 21:21:11 +02:00
2021-03-27 15:30:07 +03:00
2021-06-05 22:46:30 -07:00
2021-07-13 18:48:28 -07:00
2021-07-13 18:48:28 -07:00
2020-05-06 12:14:11 -07:00

Cat Coding — A Webview API Sample

Demonstrates VS Code's webview API. This includes:

  • Creating and showing a basic webview.
  • Dynamically updating a webview's content.
  • Loading local content in a webview.
  • Running scripts in a webview.
  • Sending message from an extension to a webview.
  • Sending messages from a webview to an extension.
  • Using a basic content security policy.
  • Webview lifecycle and handling dispose.
  • Saving and restoring state when the panel goes into the background.
  • Serialization and persistence across VS Code reboots.

Demo

demo

VS Code API

vscode module

Running the example

  • Open this example in VS Code 1.47+
  • npm install
  • npm run watch or npm run compile
  • F5 to start debugging

Run the Cat Coding: Start cat coding session to create the webview.