diff --git a/src/core/webview/WebviewProvider.ts b/src/core/webview/WebviewProvider.ts
index 6a2ecb8d..ed87fe44 100644
--- a/src/core/webview/WebviewProvider.ts
+++ b/src/core/webview/WebviewProvider.ts
@@ -5,7 +5,6 @@ import axios from "axios"
import { readFile } from "fs/promises"
import { v4 as uuidv4 } from "uuid"
import * as vscode from "vscode"
-import { Uri } from "vscode"
import { HostProvider } from "@/hosts/host-provider"
import { ShowMessageType } from "@/shared/proto/host/window"
import { WebviewProviderType } from "@/shared/webview/types"
@@ -108,12 +107,12 @@ export abstract class WebviewProvider {
}
/**
- * Converts a local URI to a webview URI that can be used within the webview.
+ * Converts a local filesystem path to a URL that can be used within the webview.
*
- * @param uri - The local URI to convert
- * @returns A URI that can be used within the webview
+ * @param path - The local path to convert
+ * @returns A URL that can be used within the webview
*/
- abstract getWebviewUri(uri: Uri): Uri
+ abstract getWebviewUrl(path: string): string
/**
* Gets the Content Security Policy source for the webview.
@@ -135,25 +134,23 @@ export abstract class WebviewProvider {
* @remarks This is also the place where references to the React webview build files
* are created and inserted into the webview HTML.
*
- * @param webview A reference to the extension webview
- * @param extensionUri The URI of the directory containing the extension
* @returns A template string literal containing the HTML that should be
* rendered within the webview panel
*/
public getHtmlContent(): string {
// Get the local path to main script run in the webview,
- // then convert it to a uri we can use in the webview.
+ // then convert it to a url we can use in the webview.
+ // The JS file from the React build output
+ const scriptUrl = this.getExtensionUrl("webview-ui", "build", "assets", "index.js")
// The CSS file from the React build output
- const stylesUri = this.getExtensionUri("webview-ui", "build", "assets", "index.css")
- // The JS file from the React build output
- const scriptUri = this.getExtensionUri("webview-ui", "build", "assets", "index.js")
+ const stylesUrl = this.getExtensionUrl("webview-ui", "build", "assets", "index.css")
// The codicon font from the React build output
// https://github.com/microsoft/vscode-extension-samples/blob/main/webview-codicons-sample/src/extension.ts
// we installed this package in the extension so that we can access it how its intended from the extension (the font file is likely bundled in vscode), and we just import the css fileinto our react app we don't have access to it
// don't forget to add font-src ${webview.cspSource};
- const codiconsUri = this.getExtensionUri("node_modules", "@vscode", "codicons", "dist", "codicon.css")
+ const codiconsUrl = this.getExtensionUrl("node_modules", "@vscode", "codicons", "dist", "codicon.css")
// Use a nonce to only allow a specific script to be run.
/*
@@ -176,8 +173,8 @@ export abstract class WebviewProvider {
-
-
+
+
-
+