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

Try using latest publushed webview iframe version for external webviews

上级 7a219ab6
......@@ -10,6 +10,7 @@ import { URI } from 'vs/base/common/uri';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { IFileService } from 'vs/platform/files/common/files';
import product from 'vs/platform/product/browser/product';
import { ITunnelService } from 'vs/platform/remote/common/tunnel';
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
import { Webview, WebviewContentOptions, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview';
......@@ -145,8 +146,7 @@ export class IFrameWebview extends Disposable implements Webview {
}
private get endpoint(): string {
const useExternalEndpoint = this._configurationService.getValue<string>('webview.experimental.useExternalEndpoint');
const baseEndpoint = useExternalEndpoint ? 'https://{{uuid}}.vscode-webview-test.com/8fa811108f0f0524c473020ef57b6620f6c201e1' : this.environmentService.options!.webviewEndpoint!;
const baseEndpoint = this.externalEndpoint || this.environmentService.options!.webviewEndpoint!;
const endpoint = baseEndpoint.replace('{{uuid}}', this.id);
if (endpoint[endpoint.length - 1] === '/') {
return endpoint.slice(0, endpoint.length - 1);
......@@ -154,6 +154,15 @@ export class IFrameWebview extends Disposable implements Webview {
return endpoint;
}
private get externalEndpoint(): string | undefined {
const useExternalEndpoint = this._configurationService.getValue<boolean>('webview.experimental.useExternalEndpoint');
if (!useExternalEndpoint) {
return undefined;
}
const commit = product.quality && product.commit ? product.commit : '211fa02efe8c041fd7baa8ec3dce199d5185aa44';
return `https://{{uuid}}.vscode-webview-test.com/${commit}`;
}
public mountTo(parent: HTMLElement) {
if (this.element) {
parent.appendChild(this.element);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册