Revisit webviewExternalEndpoint in environment (#118950) (#119780)

This commit is contained in:
Benjamin Pasero 2021-03-29 23:13:29 +02:00 committed by GitHub
parent 4dc2d399c7
commit 21fca08c97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 12 deletions

View file

@ -110,13 +110,12 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
return element;
}
protected initElement(extension: WebviewExtensionDescription | undefined, options: WebviewOptions) {
protected initElement(extension: WebviewExtensionDescription | undefined, options: WebviewOptions, extraParams?: object) {
const params = {
id: this.id,
// The extensionId and purpose in the URL are used for filtering in js-debug:
extensionId: extension?.id.value ?? '',
extensionId: extension?.id.value ?? '', // The extensionId and purpose in the URL are used for filtering in js-debug:
purpose: options.purpose,
...extraParams
} as const;
const queryString = (Object.keys(params) as Array<keyof typeof params>)

View file

@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Schemas } from 'vs/base/common/network';
import { URI } from 'vs/base/common/uri';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IFileService } from 'vs/platform/files/common/files';
@ -81,8 +80,7 @@ export class ElectronIframeWebview extends IFrameWebview {
}
protected initElement(extension: WebviewExtensionDescription | undefined, options: WebviewOptions) {
// The extensionId and purpose in the URL are used for filtering in js-debug:
this.element!.setAttribute('src', `${Schemas.vscodeWebview}://${this.id}/index.html?id=${this.id}&platform=electron&extensionId=${extension?.id.value ?? ''}&purpose=${options.purpose}`);
super.initElement(extension, options, { platform: 'electron' });
}
public set contentOptions(options: WebviewContentOptions) {

View file

@ -69,11 +69,7 @@ export class NativeWorkbenchEnvironmentService extends AbstractNativeEnvironment
get extHostLogsPath(): URI { return URI.file(join(this.logsPath, `exthost${this.configuration.windowId}`)); }
@memoize
get webviewExternalEndpoint(): string {
const baseEndpoint = 'https://{{uuid}}.vscode-webview-test.com/{{commit}}';
return baseEndpoint.replace('{{commit}}', this.productService.commit || '0d728c31ebdf03869d2687d9be0b017667c9ff37');
}
get webviewExternalEndpoint(): string { return `${Schemas.vscodeWebview}://{{uuid}}`; }
@memoize
get webviewResourceRoot(): string { return `${Schemas.vscodeWebviewResource}://{{uuid}}/{{resource}}`; }