Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/beginner-tips/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ class BeginnerTipsPage {

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = this._panel!.webview.cspSource;

return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>${WEBVIEW_TITLE}</title>
Expand Down
2 changes: 2 additions & 0 deletions src/ext-guide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ function getHtmlForWebview(webviewPanel: vscode.WebviewPanel, scriptPath: string

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = webviewPanel.webview.cspSource;
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Java Extensions Guide</title>
Expand Down
2 changes: 2 additions & 0 deletions src/formatter-settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,12 @@ export class JavaFormatterSettingsEditorProvider implements vscode.CustomTextEdi

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = this.webviewPanel!.webview.cspSource;
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Java Formatter Settings</title>
Expand Down
2 changes: 2 additions & 0 deletions src/install-jdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ class InstallJdkPage {

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = this._panel!.webview.cspSource;

return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>React App</title>
Expand Down
2 changes: 2 additions & 0 deletions src/java-runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ function getHtmlForWebview(webviewPanel: vscode.WebviewPanel, scriptPath: string

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = webviewPanel.webview.cspSource;

return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Configure Java Runtime</title>
Expand Down
2 changes: 2 additions & 0 deletions src/overview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ function getHtmlForWebview(webviewPanel: vscode.WebviewPanel, scriptPath: string

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = webviewPanel.webview.cspSource;

return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Java Overview</title>
Expand Down
2 changes: 2 additions & 0 deletions src/project-settings/projectSettingsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,12 @@ class ProjectSettingView {

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = webview.cspSource;
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Project Settings</title>
Expand Down
2 changes: 2 additions & 0 deletions src/welcome/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ function getHtmlForWebview(webviewPanel: vscode.WebviewPanel, scriptPath: string

// Use a nonce to whitelist which scripts can be run
const nonce = getNonce();
const cspSource = webviewPanel.webview.cspSource;
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src ${cspSource} https: data:; script-src 'nonce-${nonce}'; style-src ${cspSource} 'unsafe-inline'; font-src ${cspSource} https: data:;">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Java Help Center</title>
Expand Down
Loading