mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Revert "allow $openUri to accept a URI and string, adopt consumer but keep the API as is"
This reverts commit 544b0abf5b.
This commit is contained in:
@@ -19,8 +19,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService';
|
||||
import { platform } from 'vs/base/common/process';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { matchesScheme } from 'vs/platform/opener/common/opener';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
|
||||
interface LoadFunction {
|
||||
@@ -241,15 +239,15 @@ class OpenNodeModuleFactory implements INodeModuleFactory {
|
||||
const mainThreadWindow = rpcService.getProxy(MainContext.MainThreadWindow);
|
||||
|
||||
this._impl = (target, options) => {
|
||||
const uri: URI = URI.parse(target);
|
||||
// If we have options use the original method.
|
||||
if (options) {
|
||||
return this.callOriginal(target, options);
|
||||
}
|
||||
if (matchesScheme(target, Schemas.http) || matchesScheme(target, Schemas.https)) {
|
||||
return mainThreadWindow.$openUri(target, { allowTunneling: true });
|
||||
|
||||
} else if (matchesScheme(target, Schemas.mailto) || matchesScheme(target, this._appUriScheme)) {
|
||||
return mainThreadWindow.$openUri(target, {});
|
||||
if (uri.scheme === 'http' || uri.scheme === 'https') {
|
||||
return mainThreadWindow.$openUri(uri, { allowTunneling: true });
|
||||
} else if (uri.scheme === 'mailto' || uri.scheme === this._appUriScheme) {
|
||||
return mainThreadWindow.$openUri(uri, {});
|
||||
}
|
||||
return this.callOriginal(target, options);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user