Code change:
return await handler.handleURL(uri, options); } <del> private async handleUnhandledURL(uri: URI, extensionIdentifier: IExtensionIdentifier): Promise<void> { </del> <ins> private async handleUnhandledURL(uri: URI, extensionIdentifier: IExtensionIdentifier, options?: IOpenURLOptions): Promise<void> { </ins> const installedExtensions = await this.extensionManagementService.getInstalled(); <del> const extension = installedExtensions.filter(e => areSameExtensions(e.identifier, extensionIdentifier))[0]; // Extension is installed if (extension) { const enabled = this.extensionEnablementService.isEnabled(extension); // Extension is not running. Reload the window to handle. if (enabled) { this.telemetryService.publicLog2<ExtensionUrlHandlerEvent, ExtensionUrlHandlerClassification>('uri_invoked/activate_extension/start', { extensionId: extensionIdentifier.id }); const result = await this.dialogService.confirm({ message: localize('reloadAndHandle', "Extension '{0}' is not loaded. Would you like to reload the window to load the extension and open the URL?", extension.manifest.displayName || extension.manifest.name), detail: `${extension.manifest.displayName || extension.manifest.name} (${extensionIdentifier.id}) wants to open a URL:nn${uri.toString()}`, primaryButton: localize('reloadAndOpen', "&&Reload Window and Open"), type: 'question' }); if (!result.confirmed) { this.telemetryService.publicLog2<ExtensionUrlHandlerEvent, ExtensionUrlHandlerClassification>('uri_invoked/activate_extension/cancel', { extensionId: extensionIdentifier.id }); return; } this.telemetryService.publicLog2<ExtensionUrlHandlerEvent, ExtensionUrlHandlerClassification>('uri_invoked/activate_extension/accept', { extensionId: extensionIdentifier.id }); await this.reloadAndHandle(uri); } // Extension is disabled. Enable the extension and reload the window to handle. else if (this.extensionEnablementService.canChangeEnablement(extension)) { this.telemetryService.publicLog2<ExtensionUrlHandlerEvent, ExtensionUrlHandlerClassification>('uri_invoked/enable_extension/start', { extensionId: extensionIdentifier.id }); const result = await this.dialogService.confirm({ message: localize('enableAndHandle', "Extension '{0}' is disabled. Would you like to enable the extension and reload the window to open the URL?", extension.manifest.displayName || extension.manifest.name), detail: `${extension.manifest.displayName || extension.manifest.name} (${extensionIdentifier.id}) wants to open a URL:nn${uri.toString()}`, primaryButton: localize('enableAndReload', "&&Enable and Open"), type: 'question' }); if (!result.confirmed) { this.telemetryService.publicLog2<ExtensionUrlHandlerEvent, ExtensionUrlHandlerClassification>('uri_invoked/enable_extension/cancel', { extensionId: extensionIdentifier.id }); return; } this.telemetryService.publicLog2<ExtensionUrlHandlerEvent, ExtensionUrlHandlerClassification>('uri_invoked/enable_extension/accept', { extensionId: extensionIdentifier.id }); await this.extensionEnablementService.setEnablement([extension], EnablementState.EnabledGlobally); await this.reloadAndHandle(uri); } } </del> <ins> let extension = installedExtensions.find(e => areSameExtensions(e.identifier, extensionIdentifier)); </ins> // Extension is not installed <del> else { </del> <ins> if (!extension) { </ins> let galleryExtension: IGalleryExtension | undefined; try {

Related discussion:
text: Open following url Install dialog is shown asking user to install and open extension <img width="275" alt="image" src="https://user-"- After clicking on install, following prompt is shown <img width="454" alt="image" src="https://user-"Second prompt seems to be unnecessary. It is expected to open the URL after installing