Allow webview iframe to load styles

This commit is contained in:
Asher 2019-03-12 12:55:43 -05:00
parent e597d49912
commit 3155eb76f5
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
1 changed files with 1 additions and 0 deletions

View File

@ -141,6 +141,7 @@ const newCreateElement = <K extends keyof HTMLElementTagNameMap>(tagName: K): HT
// TODO // TODO
args[0].contents = (args[0].contents as string).replace(/"(file:\/\/[^"]*)"/g, (m1) => `"/resource${m1}"`); args[0].contents = (args[0].contents as string).replace(/"(file:\/\/[^"]*)"/g, (m1) => `"/resource${m1}"`);
args[0].contents = (args[0].contents as string).replace(/"vscode-resource:([^"]*)"/g, (m, m1) => `"/resource${m1}"`); args[0].contents = (args[0].contents as string).replace(/"vscode-resource:([^"]*)"/g, (m, m1) => `"/resource${m1}"`);
args[0].contents = (args[0].contents as string).replace(/style-src vscode-core-resource:/g, "style-src 'self'");
} }
if (view.contentWindow) { if (view.contentWindow) {
view.contentWindow.postMessage({ view.contentWindow.postMessage({