From 07521ebaa45e894197a04d2e90aa59e57baa50eb Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 4 Jun 2018 09:32:49 -0700 Subject: [PATCH] Fix loading of local resources in webview --- src/vs/workbench/api/electron-browser/mainThreadWebview.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadWebview.ts b/src/vs/workbench/api/electron-browser/mainThreadWebview.ts index b8dba6902ed..b4943cc15fe 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWebview.ts @@ -77,7 +77,10 @@ export class MainThreadWebviews implements MainThreadWebviewsShape, WebviewReviv mainThreadShowOptions.group = viewColumnToEditorGroup(this._editorGroupService, showOptions.viewColumn); } - const webview = this._webviewService.createWebview(MainThreadWebviews.viewType, title, mainThreadShowOptions, options, URI.revive(extensionLocation), this.createWebviewEventDelegate(handle)); + const webview = this._webviewService.createWebview(MainThreadWebviews.viewType, title, mainThreadShowOptions, { + ...options, + localResourceRoots: Array.isArray(options.localResourceRoots) ? options.localResourceRoots.map(URI.revive) : undefined + }, URI.revive(extensionLocation), this.createWebviewEventDelegate(handle)); webview.state = { viewType: viewType, state: undefined