Get Webview Content with URI | Visual Studio Extension Building

PHOTO EMBED

Sat Feb 06 2021 13:11:49 GMT+0000 (Coordinated Universal Time)

Saved by @mishka #javascript


function getWebviewContent(uri) {
return `<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel='stylesheet' href='`+ uri + `' /> //This is the addition
    <title>Example Webview</title>
</head>
<body>
 <h1>This works!</h1>
 //Add some custom HTML here
   </body>
   </html>`;
}
content_copyCOPY

https://mishka.codes/webviews-in-vscode