@@ -560,24 +560,8 @@ var requirejs = (function() {
560
560
return ;
561
561
}
562
562
563
- if ( matchesScheme ( link , Schemas . command ) ) {
564
- const ret = / c o m m a n d \: w o r k b e n c h \. a c t i o n \. o p e n L a r g e O u t p u t \? ( .* ) / . exec ( link ) ;
565
- if ( ret && ret . length === 2 ) {
566
- const outputId = ret [ 1 ] ;
567
- this . openerService . open ( CellUri . generateCellOutputUri ( this . documentUri , outputId ) ) ;
568
- return ;
569
- }
570
- console . warn ( 'Command links are deprecated and will be removed, use message passing instead: https://github.com/microsoft/vscode/issues/123601' ) ;
571
- }
572
-
573
- if ( matchesScheme ( link , Schemas . command ) ) {
574
- if ( this . workspaceTrustManagementService . isWorkspaceTrusted ( ) ) {
575
- this . openerService . open ( link , { fromUserGesture : true , allowContributedOpeners : true , allowCommands : true } ) ;
576
- } else {
577
- console . warn ( 'Command links are disabled in untrusted workspaces' ) ;
578
- }
579
- } else if ( matchesSomeScheme ( link , Schemas . vscodeNotebookCell , Schemas . http , Schemas . https , Schemas . mailto ) ) {
580
- this . openerService . open ( link , { fromUserGesture : true , allowContributedOpeners : true , allowCommands : true } ) ;
563
+ if ( matchesSomeScheme ( link , Schemas . vscodeNotebookCell , Schemas . http , Schemas . https , Schemas . mailto ) ) {
564
+ this . openerService . open ( link , { fromUserGesture : true , allowContributedOpeners : true , allowCommands : false } ) ;
581
565
}
582
566
} ) ) ;
583
567
@@ -696,23 +680,35 @@ var requirejs = (function() {
696
680
}
697
681
case 'clicked-link' : {
698
682
let linkToOpen : URI | string | undefined ;
683
+
699
684
if ( matchesScheme ( data . href , Schemas . command ) ) {
700
- const ret = / c o m m a n d \: w o r k b e n c h \. a c t i o n \. o p e n L a r g e O u t p u t \? ( .* ) / . exec ( data . href ) ;
701
- if ( ret && ret . length === 2 ) {
702
- const outputId = ret [ 1 ] ;
703
- const group = this . editorGroupService . activeGroup ;
704
-
705
- if ( group ) {
706
- if ( group . activeEditor ) {
707
- group . pinEditor ( group . activeEditor ) ;
685
+ // We allow a very limited set of commands
686
+ const uri = URI . parse ( data . href ) ;
687
+ switch ( uri . path ) {
688
+ case 'workbench.action.openLargeOutput' : {
689
+ const outputId = uri . query ;
690
+ const group = this . editorGroupService . activeGroup ;
691
+ if ( group ) {
692
+ if ( group . activeEditor ) {
693
+ group . pinEditor ( group . activeEditor ) ;
694
+ }
708
695
}
709
- }
710
696
711
- this . openerService . open ( CellUri . generateCellOutputUri ( this . documentUri , outputId ) ) ;
712
- return ;
697
+ this . openerService . open ( CellUri . generateCellOutputUri ( this . documentUri , outputId ) ) ;
698
+ return ;
699
+ }
700
+ case 'github-issues.authNow' :
701
+ case 'workbench.extensions.search' :
702
+ case 'workbench.extensions.openSettings' : {
703
+ this . openerService . open ( data . href , { fromUserGesture : true , allowCommands : true , fromWorkspace : true } ) ;
704
+ return ;
705
+ }
713
706
}
707
+
708
+ return ;
714
709
}
715
- if ( matchesSomeScheme ( data . href , Schemas . http , Schemas . https , Schemas . mailto , Schemas . command , Schemas . vscodeNotebookCell , Schemas . vscodeNotebook ) ) {
710
+
711
+ if ( matchesSomeScheme ( data . href , Schemas . http , Schemas . https , Schemas . mailto , Schemas . vscodeNotebookCell , Schemas . vscodeNotebook ) ) {
716
712
linkToOpen = data . href ;
717
713
} else if ( ! / ^ [ \w \- ] + : / . test ( data . href ) ) {
718
714
const fragmentStartIndex = data . href . lastIndexOf ( '#' ) ;
@@ -743,7 +739,7 @@ var requirejs = (function() {
743
739
}
744
740
745
741
if ( linkToOpen ) {
746
- this . openerService . open ( linkToOpen , { fromUserGesture : true , allowCommands : true , fromWorkspace : true } ) ;
742
+ this . openerService . open ( linkToOpen , { fromUserGesture : true , allowCommands : false , fromWorkspace : true } ) ;
747
743
}
748
744
break ;
749
745
}
0 commit comments