Support loading webviews from wildcard endpoints

Fixes #77132

Add support for loading webviews from and endpoint that looks like:

```
https://{{uuid}}.contoso.com/path/to/some/commit/index.html
```

This lets us serve each webview from a seperate origin
This commit is contained in:
Matt Bierner
2019-07-12 15:37:48 -07:00
parent 8536df96d0
commit 5106b556bd
15 changed files with 45 additions and 29 deletions

View File

@@ -93,7 +93,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
mainThreadShowOptions.group = viewColumnToEditorGroup(this._editorGroupService, showOptions.viewColumn);
}
const webview = this._webviewEditorService.createWebview(this.getInternalWebviewId(viewType), title, mainThreadShowOptions, reviveWebviewOptions(options), {
const webview = this._webviewEditorService.createWebview(handle, this.getInternalWebviewViewType(viewType), title, mainThreadShowOptions, reviveWebviewOptions(options), {
location: URI.revive(extensionLocation),
id: extensionId
}, this.createWebviewEventDelegate(handle)) as WebviewEditorInput<MainThreadWebviewState>;
@@ -212,7 +212,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
this._revivers.delete(viewType);
}
private getInternalWebviewId(viewType: string): string {
private getInternalWebviewViewType(viewType: string): string {
return `mainThreadWebview-${viewType}`;
}