提交 e37d0e7e 编写于 作者: M Matt Bierner

Auto rewrite vscode-resource entries in csp in web iframe based webviews

上级 e44d9a28
......@@ -289,6 +289,11 @@
const csp = newDocument.querySelector('meta[http-equiv="Content-Security-Policy"]');
if (!csp) {
host.postMessage('no-csp-found');
} else {
// Rewrite vscode-resource in csp
if (data.endpoint) {
csp.setAttribute('content', csp.getAttribute('content').replace(/vscode-resource:/g, data.endpoint));
}
}
// set DOCTYPE for newDocument explicitly as DOMParser.parseFromString strips it off
......
......@@ -202,7 +202,8 @@ export class IFrameWebview extends Disposable implements Webview {
this._send('content', {
contents: this.content.html,
options: this.content.options,
state: this.content.state
state: this.content.state,
endpoint: this.endpoint,
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册