opn/open should work with app URI scheme too

This commit is contained in:
Benjamin Pasero
2019-10-22 11:57:36 +02:00
parent 21da9e008b
commit d712aeb26b

View File

@@ -57,7 +57,7 @@ export abstract class RequireInterceptor {
this.register(new VSCodeNodeModuleFactory(this._apiFactory, extensionPaths, this._extensionRegistry, configProvider));
this.register(this._instaService.createInstance(KeytarNodeModuleFactory));
if (this._initData.remote.isRemote) {
this.register(this._instaService.createInstance(OpenNodeModuleFactory, extensionPaths));
this.register(this._instaService.createInstance(OpenNodeModuleFactory, extensionPaths, this._initData.environment.appUriScheme));
}
}
@@ -228,6 +228,7 @@ class OpenNodeModuleFactory implements INodeModuleFactory {
constructor(
private readonly _extensionPaths: TernarySearchTree<IExtensionDescription>,
private readonly _appUriScheme: string,
@IExtHostRpcService rpcService: IExtHostRpcService,
) {
@@ -242,7 +243,7 @@ class OpenNodeModuleFactory implements INodeModuleFactory {
}
if (uri.scheme === 'http' || uri.scheme === 'https') {
return mainThreadWindow.$openUri(uri, { allowTunneling: true });
} else if (uri.scheme === 'mailto') {
} else if (uri.scheme === 'mailto' || uri.scheme === this._appUriScheme) {
return mainThreadWindow.$openUri(uri, {});
}
return this.callOriginal(target, options);