Skip to content

Feature/emotion #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 12, 2020
Prev Previous commit
Next Next commit
fix csp issue
  • Loading branch information
ShMcK committed Jan 12, 2020
commit 54d146e5066479d095c21440454c2739170ca958
4 changes: 3 additions & 1 deletion src/webview/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {
cspMeta.httpEquiv = 'Content-Security-Policy'
cspMeta.content =
[
`default-src 'self'`,
`connect-src https: http:`,
`font-src ${panel.webview.cspSource} http: https: data:`,
`img-src ${panel.webview.cspSource} https:`,
`script-src ${nonces.map(nonce => `'nonce-${nonce}'`).join(' ')} data:`,
`style-src ${panel.webview.cspSource} https:`,
`style-src ${panel.webview.cspSource} https: 'self' 'unsafe-inline'`,
].join('; ') + ';'
document.head.appendChild(cspMeta)

Expand Down