@@ -15,7 +15,7 @@ import { areSameExtensions } from 'vs/platform/extensionManagement/common/extens
1515import { createDecorator } from 'vs/platform/instantiation/common/instantiation' ;
1616import { INotificationHandle , INotificationService , Severity } from 'vs/platform/notification/common/notification' ;
1717import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
18- import { IURLHandler , IURLService } from 'vs/platform/url/common/url' ;
18+ import { IURLHandler , IURLService , IOpenURLOptions } from 'vs/platform/url/common/url' ;
1919import { IHostService } from 'vs/workbench/services/host/browser/host' ;
2020import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions' ;
2121import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions' ;
@@ -74,7 +74,7 @@ class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler {
7474 const urlToHandleValue = this . storageService . get ( URL_TO_HANDLE , StorageScope . WORKSPACE ) ;
7575 if ( urlToHandleValue ) {
7676 this . storageService . remove ( URL_TO_HANDLE , StorageScope . WORKSPACE ) ;
77- this . handleURL ( URI . revive ( JSON . parse ( urlToHandleValue ) ) , true ) ;
77+ this . handleURL ( URI . revive ( JSON . parse ( urlToHandleValue ) ) , { trusted : true } ) ;
7878 }
7979
8080 this . disposable = combinedDisposable (
@@ -86,7 +86,7 @@ class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler {
8686 setTimeout ( ( ) => cache . forEach ( uri => this . handleURL ( uri ) ) ) ;
8787 }
8888
89- async handleURL ( uri : URI , confirmed ?: boolean ) : Promise < boolean > {
89+ async handleURL ( uri : URI , options ?: IOpenURLOptions ) : Promise < boolean > {
9090 if ( ! isExtensionId ( uri . authority ) ) {
9191 return false ;
9292 }
@@ -100,12 +100,15 @@ class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler {
100100 return true ;
101101 }
102102
103- if ( ! confirmed ) {
103+ let showConfirm : boolean ;
104+ if ( options && options . trusted ) {
105+ showConfirm = false ;
106+ } else {
104107 const confirmedExtensionIds = this . getConfirmedExtensionIds ( ) ;
105- confirmed = confirmedExtensionIds . has ( ExtensionIdentifier . toKey ( extensionId ) ) ;
108+ showConfirm = ! confirmedExtensionIds . has ( ExtensionIdentifier . toKey ( extensionId ) ) ;
106109 }
107110
108- if ( ! confirmed ) {
111+ if ( showConfirm ) {
109112 let uriString = uri . toString ( ) ;
110113
111114 if ( uriString . length > 40 ) {
@@ -136,7 +139,7 @@ class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler {
136139 if ( handler ) {
137140 if ( ! wasHandlerAvailable ) {
138141 // forward it directly
139- return await handler . handleURL ( uri ) ;
142+ return await handler . handleURL ( uri , options ) ;
140143 }
141144
142145 // let the ExtensionUrlHandler instance handle this
@@ -343,7 +346,7 @@ class ExtensionUrlBootstrapHandler implements IWorkbenchContribution, IURLHandle
343346 ExtensionUrlBootstrapHandler . disposable = urlService . registerHandler ( this ) ;
344347 }
345348
346- handleURL ( uri : URI ) : Promise < boolean > {
349+ handleURL ( uri : URI , options ?: IOpenURLOptions ) : Promise < boolean > {
347350 ExtensionUrlBootstrapHandler . _cache . push ( uri ) ;
348351 return Promise . resolve ( true ) ;
349352 }
0 commit comments