Skip to content

Commit

Permalink
Add fallback webviewExternalEndpoint in code
Browse files Browse the repository at this point in the history
Seems not having this breaks some derived apps
  • Loading branch information
mjbvz committed May 22, 2021
1 parent 8f11975 commit 5319757
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/vs/base/common/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
1 change: 0 additions & 1 deletion src/vs/platform/product/common/product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 5319757

Please sign in to comment.