Add fallback webviewExternalEndpoint in code

Seems not having this breaks some derived apps
This commit is contained in:
Matt Bierner 2021-05-22 13:32:54 -07:00
parent 8f11975c47
commit 5319757634
No known key found for this signature in database
GPG key ID: 099C331567E11888
3 changed files with 5 additions and 3 deletions

View file

@ -136,7 +136,7 @@ export interface IProductConfiguration {
readonly darwinUniversalAssetId?: string;
readonly webviewContentExternalBaseUrlTemplate: string;
readonly webviewContentExternalBaseUrlTemplate?: string;
}
export type ImportantExtensionTip = { name: string; languages?: string[]; pattern?: string; isExtensionPack?: boolean };

View file

@ -63,7 +63,6 @@ else {
reportIssueUrl: 'https://github.com/microsoft/vscode/issues/new',
licenseName: 'MIT',
licenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt',
webviewContentExternalBaseUrlTemplate: 'https://{{uuid}}.vscode-webview.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/',
extensionAllowedProposedApi: [
'ms-vscode.vscode-js-profile-flame',
'ms-vscode.vscode-js-profile-table',

View file

@ -228,7 +228,10 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
@memoize
get webviewExternalEndpoint(): string {
const endpoint = this.options.webviewEndpoint || this.productService.webviewContentExternalBaseUrlTemplate;
const endpoint = this.options.webviewEndpoint
|| this.productService.webviewContentExternalBaseUrlTemplate
|| 'https://{{uuid}}.vscode-webview.net/{{quality}}/{{commit}}/out/vs/workbench/contrib/webview/browser/pre/';
return endpoint
.replace('{{commit}}', this.productService.commit || '97740a7d253650f9f186c211de5247e2577ce9f7')
.replace('{{quality}}', this.productService.quality || 'insider');