src/vs/workbench/browser/window.ts/BrowserWindow/setupOpenHandlers
class BrowserWindow:	private setupOpenHandlers(): void {

		// We need to ignore the `beforeunload` event while
		// we handle external links to open specifically for
		// the case of application protocols that e.g. invoke
		// vscode itself. We do not want to open these links
		// in a new window because that would leave a blank
		// window to the user, but using `window.location.href`
		// will trigger the `beforeunload`.
		this.openerService.setDefaultExternalOpener({
			openExternal: async (href: string) => {
				if (matchesScheme(href, Schemas.http) || matchesScheme(href, Schemas.https)) {
					const opened = windowOpenNoOpenerWithSuccess(href);
					if (!opened) {
						const showResult = await this.dialogService.show(
							Severity.Warning,
							localize('unableToOpenExternal', "The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."),
							[
								localize('open', "Open"),
								localize('learnMore', "Learn More"),
								localize('cancel', "Cancel")
							],
							{
								cancelId: 2,
								detail: href
							}
						);

						if (showResult.choice === 0) {
							windowOpenNoOpener(href);
						}

						if (showResult.choice === 1) {
							await this.openerService.open(URI.parse('https://aka.ms/allow-vscode-popup'));
						}
					}
				} else {
					this.lifecycleService.withExpectedUnload(() => window.location.href = href);
				}

				return true;
			}
		});
	}