Code change:
const toplevelDomainSegements = parsedDomainToConfigure.authority.split('.'); const domainEnd = toplevelDomainSegements.slice(toplevelDomainSegements.length - 2).join('.'); const topLevelDomain = '*.' + domainEnd; <ins> const options: ConfigureTrustedDomainsQuickPickItem[] = []; </ins> <del> const trustDomainAndOpenLinkItem: ConfigureTrustedDomainsQuickPickItem = { </del> <ins> options.push({ </ins> type: 'item', label: localize('trustedDomain.trustDomain', 'Trust {0}', domainToConfigure), <del> id: 'trustDomain', </del> <ins> id: 'trust', toTrust: domainToConfigure, </ins> picked: true <del> }; const trustSubDomainAndOpenLinkItem: ConfigureTrustedDomainsQuickPickItem = { type: 'item', label: localize('trustedDomain.trustSubDomain', 'Trust {0} and all its subdomains', domainEnd), id: 'trustSubdomain' }; const openAllLinksItem: ConfigureTrustedDomainsQuickPickItem = { </del> <ins> }); const isIP = toplevelDomainSegements.length === 4 && toplevelDomainSegements.every(segment => Number.isInteger(+segment) || Number.isInteger(+segment.split(':')[0])); if (isIP) { if (parsedDomainToConfigure.authority.includes(':')) { const base = parsedDomainToConfigure.authority.split(':')[0]; options.push({ type: 'item', label: localize('trustedDomain.trustAllPorts', 'Trust {0} on all ports', base), toTrust: base + ':*', id: 'trust' }); } } else { options.push({ type: 'item', label: localize('trustedDomain.trustSubDomain', 'Trust {0} and all its subdomains', domainEnd), toTrust: topLevelDomain, id: 'trust' }); } options.push({ </ins> type: 'item', label: localize('trustedDomain.trustAllDomains', 'Trust all domains (disables link protection)'), <del> id: 'trustAll' }; const manageTrustedDomainItem: ConfigureTrustedDomainsQuickPickItem = { </del> <ins> toTrust: '*', id: 'trust' }); options.push({ </ins> type: 'item', label: localize('trustedDomain.manageTrustedDomains', 'Manage Trusted Domains'), id: 'manage' <del> }; </del> <ins> }); </ins> const pickedResult = await quickInputService.pick<ConfigureTrustedDomainsQuickPickItem>( <del> [trustDomainAndOpenLinkItem, trustSubDomainAndOpenLinkItem, openAllLinksItem, manageTrustedDomainItem], { activeItem: trustDomainAndOpenLinkItem } </del> <ins> options, { activeItem: options[0] } </ins> ); if (pickedResult && pickedResult.id) {

Related discussion:
text: Issue Type: <bBug</bWrite http://192.168.1.7:3000/ into a text file. Command-click it to try to open the link. You will get an alert asking whether you want to open the external website. Click “Configure Trusted Domains”. <img width="1025" alt="link and dialog asking to confirm opening external website" src="https://user-"Look at the second option in the menu. It says “Trust 1.7:3000 and all its subdomains”. But 1.7:3000 is not a valid address. <img width="1024" alt="link and menu with buggy entry “Trust 1.7:3000 and all its subdomains”" src="https://user-"I can only guess that VS Code thinks that “7” is a TLD and “1.7” is a full domain name. What I actually want to do is whitelist opening all links to IP addresses like . In other words, white-list the subnet . At least, I think that makes sense. But I am not a network engineer, so if it makes more sense to recommend to the user whitelisting some other subnet such as , or whitelisting only the address but on any port, that would be fine too. VS Code version: Code 1.40.1 (, 2019-11-13T16:47:44.719Z) OS version: Darwin x64 18.7.0 <!-- generated by issue reporter --