@@ -35,7 +35,7 @@ async function initializeJavaExtGuideView(context: vscode.ExtensionContext, webv
3535 dark : vscode . Uri . file ( path . join ( context . extensionPath , "caption.dark.svg" ) )
3636 } ;
3737
38- webviewPanel . webview . html = getHtmlForWebview ( context . asAbsolutePath ( "./out/assets/ext-guide/index.js" ) ) ;
38+ webviewPanel . webview . html = getHtmlForWebview ( webviewPanel , context . asAbsolutePath ( "./out/assets/ext-guide/index.js" ) ) ;
3939
4040 context . subscriptions . push ( webviewPanel . onDidDispose ( onDisposeCallback ) ) ;
4141 context . subscriptions . push ( webviewPanel . webview . onDidReceiveMessage ( async ( e ) => {
@@ -68,9 +68,10 @@ async function initializeJavaExtGuideView(context: vscode.ExtensionContext, webv
6868 syncExtensionStatus ( ) ;
6969}
7070
71- function getHtmlForWebview ( scriptPath : string ) {
71+ function getHtmlForWebview ( webviewPanel : vscode . WebviewPanel , scriptPath : string ) {
7272 const scriptPathOnDisk = vscode . Uri . file ( scriptPath ) ;
73- const scriptUri = ( scriptPathOnDisk ) . with ( { scheme : "vscode-resource" } ) ;
73+ const scriptUri = webviewPanel . webview . asWebviewUri ( scriptPathOnDisk ) ;
74+
7475 // Use a nonce to whitelist which scripts can be run
7576 const nonce = getNonce ( ) ;
7677 return `<!DOCTYPE html>
@@ -113,7 +114,7 @@ function getHtmlForWebview(scriptPath: string) {
113114 </div>
114115 <div class="col-5">
115116 <div class="tab-content">
116-
117+
117118 <!-- Basics -->
118119 <div class="tab-pane fade show active" id="panel-basics" role="tabpanel" aria-labelledby="tab-basics">
119120 <table class="table table-borderless table-hover table-sm">
@@ -125,7 +126,7 @@ function getHtmlForWebview(scriptPath: string) {
125126 <label class="form-check-label" for="chk.redhat.java">
126127 Language Support for Java by Red Hat
127128 </label>
128-
129+
129130 </div>
130131 </td>
131132 </tr>
@@ -182,7 +183,7 @@ function getHtmlForWebview(scriptPath: string) {
182183 </tbody>
183184 </table>
184185 </div>
185-
186+
186187 <!-- Frameworks -->
187188 <div class="tab-pane fade" id="panel-frameworks" role="tabpanel" aria-labelledby="tab-frameworks">
188189 <table class="table table-borderless table-hover table-sm">
@@ -220,7 +221,7 @@ function getHtmlForWebview(scriptPath: string) {
220221 </tbody>
221222 </table>
222223 </div>
223-
224+
224225 <!-- Application Servers -->
225226 <div class="tab-pane fade" id="panel-app-servers" role="tabpanel" aria-labelledby="tab-app-servers">
226227 <table class="table table-borderless table-hover table-sm">
@@ -238,7 +239,7 @@ function getHtmlForWebview(scriptPath: string) {
238239 </tbody>
239240 </table>
240241 </div>
241-
242+
242243 <!-- Keymaps -->
243244 <div class="tab-pane fade" id="panel-keymaps" role="tabpanel" aria-labelledby="tab-keymaps">
244245 <table class="table table-borderless table-hover table-sm">
@@ -266,7 +267,7 @@ function getHtmlForWebview(scriptPath: string) {
266267 </tbody>
267268 </table>
268269 </div>
269-
270+
270271 </div>
271272 </div>
272273 <div class="col-4">
@@ -324,7 +325,7 @@ function getHtmlForWebview(scriptPath: string) {
324325 </div>
325326 </div>
326327 </body>
327-
328+
328329 </html>
329330 ` ;
330331}
0 commit comments