Add all valid hosts to simple browser (#120929)

and pass sourceUri not targetUri
This commit is contained in:
Alex Ross 2021-04-09 16:54:31 +02:00 committed by GitHub
parent 84043ab3b8
commit 2894338f38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -16,7 +16,16 @@ const showCommand = 'simpleBrowser.show';
const enabledHosts = new Set<string>([
'localhost',
'127.0.0.1'
// localhost IPv4
'127.0.0.1',
// localhost IPv6
'0:0:0:0:0:0:0:1',
'::1',
// all interfaces IPv4
'0.0.0.0',
// all interfaces IPv6
'0:0:0:0:0:0:0:0',
'::'
]);
const openerId = 'simpleBrowser.open';

View file

@ -108,7 +108,7 @@ export class ExternalUriOpenerService extends Disposable implements IExternalUri
await Promise.all(Array.from(allOpeners.values()).map(async opener => {
let priority: modes.ExternalUriOpenerPriority;
try {
priority = await opener.canOpen(targetUri, token);
priority = await opener.canOpen(ctx.sourceUri, token);
} catch (e) {
this.logService.error(e);
return;