File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/vs/workbench/api/common Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import { VSBuffer } from 'vs/base/common/buffer' ;
7
7
import { Emitter , Event } from 'vs/base/common/event' ;
8
+ import { Schemas } from 'vs/base/common/network' ;
8
9
import { URI } from 'vs/base/common/uri' ;
9
10
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions' ;
10
11
import { normalizeVersion , parseVersion } from 'vs/platform/extensions/common/extensionValidator' ;
@@ -73,6 +74,12 @@ export class ExtHostWebview implements vscode.Webview {
73
74
}
74
75
75
76
public get cspSource ( ) : string {
77
+ const extensionLocation = this . #extension. extensionLocation ;
78
+ if ( extensionLocation . scheme === Schemas . https || extensionLocation . scheme === Schemas . http ) {
79
+ // The extension is being served up from a CDN.
80
+ // Also include the CDN in the default csp.
81
+ return extensionLocation + ' ' + webviewGenericCspSource ;
82
+ }
76
83
return webviewGenericCspSource ;
77
84
}
78
85
You can’t perform that action at this time.
0 commit comments