Skip to content

Commit a48c2fb

Browse files
committed
Handle webview service worker resource requests
1 parent 07ec4ca commit a48c2fb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/channel.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,15 @@ export class FileProviderChannel implements IServerChannel, IDisposable {
166166
// HACK: for now assume /out is relative to the build (used for the
167167
// walkthrough content).
168168
if (resource.path.indexOf("/out") === 0) {
169-
resource.path = this.environmentService.appRoot + resource.path;
169+
return URI.file(this.environmentService.appRoot + resource.path);
170+
// This is used by the webview service worker to load resources.
171+
} else if (resource.path === "/vscode-resource" && resource.query) {
172+
try {
173+
const query = JSON.parse(resource.query);
174+
if (query.requestResourcePath) {
175+
return URI.file(query.requestResourcePath);
176+
}
177+
} catch (error) { /* Carry on. */ }
170178
}
171179
return URI.from(resource);
172180
}

0 commit comments

Comments
 (0)