Skip to content

Commit

Permalink
fix: Add CSP in the web view header (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Aug 27, 2019
1 parent b96e7f5 commit 24f636d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/webview/leetCodePreviewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class LeetCodePreviewProvider extends LeetCodeWebview {
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https:; script-src vscode-resource: 'unsafe-inline'; style-src vscode-resource: 'unsafe-inline';"/>
${markdownEngine.getStyles()}
${!this.sideMode ? button.style : ""}
<style>
Expand Down
1 change: 1 addition & 0 deletions src/webview/leetCodeSolutionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class LeetCodeSolutionProvider extends LeetCodeWebview {
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https:; script-src vscode-resource:; style-src vscode-resource:;"/>
${styles}
</head>
<body class="vscode-body 'scrollBeyondLastLine' 'wordWrap' 'showEditorSelection'" style="tab-size:4">
Expand Down
1 change: 1 addition & 0 deletions src/webview/leetCodeSubmissionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class LeetCodeSubmissionProvider extends LeetCodeWebview {
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src https:; script-src vscode-resource:; style-src vscode-resource:;"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
${markdownEngine.getStyles()}
Expand Down

0 comments on commit 24f636d

Please sign in to comment.