Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1b806b6

Browse files
committed
refactor csp
1 parent850830b commit1b806b6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

‎src/webview/render.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {
6464
// set CSP (content security policy) to grant permission to local files
6565
constcspMeta:HTMLMetaElement=document.createElement('meta')
6666
cspMeta.httpEquiv='Content-Security-Policy'
67-
cspMeta.content=[
68-
`font-src${panel.webview.cspSource} http: https: data:;`,
69-
`img-src${panel.webview.cspSource} https:;`,
70-
`script-src${nonces.map(nonce=>`'nonce-${nonce}'`).join(' ')};`,
71-
`style-src${panel.webview.cspSource} https:;`,
72-
].join(' ')
67+
cspMeta.content=
68+
[
69+
`font-src${panel.webview.cspSource} http: https: data:`,
70+
`img-src${panel.webview.cspSource} https:`,
71+
`script-src${nonces.map(nonce=>`'nonce-${nonce}'`).join(' ')} data:`,
72+
`style-src${panel.webview.cspSource} https:`,
73+
].join('; ')+';'
7374
document.head.appendChild(cspMeta)
7475

7576
// stringify dom

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp