This repo contains a library project vscode-webview-dialog
and a test/demo VS Code extension project vscode-webview-dialog-test
that references the library.
- Open the repo root directory in VS Code.
- Run
yarn
at the root. - Press F5 to launch the test extension in a new VS Code window.
- Use the command palette to invoke the command:
WebView Dialog Test: Show Dialog
The test extension uses the WebviewDialog
class in the library to create a simple dialog. The dialog loads CSS and script from separate files in a secure way (with a CSP). The script communicates with the main extension via messages: sending result or cancellation actions.