-
Notifications
You must be signed in to change notification settings - Fork 202
Fix Graphviz WASM module not loading for graph viewer #2085
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
Changes from 3 commits
bc51e74
d3e6453
b3d9804
074229e
3043300
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -129,10 +129,13 @@ export function getHtmlForWebview( | |||||||
view: WebviewView, | ||||||||
{ | ||||||||
allowInlineStyles, | ||||||||
allowWasmEval, | ||||||||
}: { | ||||||||
allowInlineStyles?: boolean; | ||||||||
allowWasmEval?: boolean; | ||||||||
} = { | ||||||||
allowInlineStyles: false, | ||||||||
allowWasmEval: false, | ||||||||
}, | ||||||||
): string { | ||||||||
const scriptUriOnDisk = Uri.file(ctx.asAbsolutePath("out/webview.js")); | ||||||||
|
@@ -163,7 +166,7 @@ export function getHtmlForWebview( | |||||||
/* | ||||||||
* Content security policy: | ||||||||
* default-src: allow nothing by default. | ||||||||
* script-src: allow only the given script, using the nonce. | ||||||||
* script-src: allow the given script, using the nonce. also allow loading WebAssembly modules. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||||
* style-src: allow only the given stylesheet, using the nonce. | ||||||||
* connect-src: only allow fetch calls to webview resource URIs | ||||||||
* (this is used to load BQRS result files). | ||||||||
|
@@ -172,7 +175,9 @@ export function getHtmlForWebview( | |||||||
<html> | ||||||||
<head> | ||||||||
<meta http-equiv="Content-Security-Policy" | ||||||||
content="default-src 'none'; script-src 'nonce-${nonce}'; font-src ${fontSrc}; style-src ${styleSrc}; connect-src ${ | ||||||||
content="default-src 'none'; script-src 'nonce-${nonce}'${ | ||||||||
allowWasmEval ? " 'wasm-unsafe-eval'" : "" | ||||||||
}; font-src ${fontSrc}; style-src ${styleSrc}; connect-src ${ | ||||||||
webview.cspSource | ||||||||
};"> | ||||||||
${stylesheetsHtmlLines.join(` ${EOL}`)} | ||||||||
|
Uh oh!
There was an error while loading. Please reload this page.