Skip to content

Commit

Permalink
Allow http/https in notebook webview in development. Fix #95988
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Apr 24, 2020
1 parent 0f0eb99 commit 37944c8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { Emitter, Event } from 'vs/base/common/event';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { getPathFromAmdModule } from 'vs/base/common/amd';
import { isWeb } from 'vs/base/common/platform';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';

export interface IDimensionMessage {
__vscode_notebook_message: boolean;
Expand Down Expand Up @@ -114,6 +115,7 @@ export class BackLayerWebView extends Disposable {
@IWebviewService readonly webviewService: IWebviewService,
@IOpenerService readonly openerService: IOpenerService,
@INotebookService private readonly notebookService: INotebookService,
@IEnvironmentService private readonly environmentService: IEnvironmentService
) {
super();
this.element = document.createElement('div');
Expand Down Expand Up @@ -594,7 +596,12 @@ ${loaderJs}
let rendererInfo = this.notebookService.getRendererInfo(preload);

if (rendererInfo) {
let preloadResources = rendererInfo.preloads.map(preloadResource => preloadResource.with({ scheme: WebviewResourceScheme }));
let preloadResources = rendererInfo.preloads.map(preloadResource => {
if (this.environmentService.isExtensionDevelopment && (preloadResource.scheme === 'http' || preloadResource.scheme === 'https')) {
return preloadResource;
}
return preloadResource.with({ scheme: WebviewResourceScheme });
});
extensionLocations.push(rendererInfo.extensionLocation);
preloadResources.forEach(e => {
if (!this.preloadsCache.has(e.toString())) {
Expand Down

0 comments on commit 37944c8

Please sign in to comment.