@@ -49,7 +49,7 @@ export function activate(context: vscode.ExtensionContext) {
4949 if ( config && config . type == debuggerType ) {
5050 let targetUri : string = utils . getUrlFromConfig ( folder , config ) ;
5151 if ( config . request && config . request . localeCompare ( 'attach' , 'en' , { sensitivity : 'base' } ) == 0 ) {
52- attach ( context , /* viaConfig= */ true , defaultUrl ) ;
52+ attach ( context , /* viaConfig= */ true , targetUri ) ;
5353 } else if ( config . request && config . request . localeCompare ( 'launch' , 'en' , { sensitivity : 'base' } ) == 0 ) {
5454 launch ( context , targetUri , config . chromePath ) ;
5555 }
@@ -112,20 +112,20 @@ async function attach(context: vscode.ExtensionContext, viaConfig: boolean, targ
112112 } ) ;
113113 } ) ;
114114
115- let targetUrl : string = '' ;
116115 let targetMatch :boolean = false ;
116+ let targetWebsocketUrl :string = '' ;
117117 if ( typeof targetUrl === 'string' && targetUrl . length > 0 && targetUrl != defaultUrl ) {
118- const matches = items . filter ( i => i . description == defaultUrl ) ;
118+ const matches = items . filter ( i => targetUrl . localeCompare ( i . description , 'en' , { sensitivity : 'base' } ) == 0 ) ;
119119 if ( matches && matches . length > 0 ) {
120- targetUrl = matches [ 0 ] . description ;
120+ targetWebsocketUrl = matches [ 0 ] . detail ;
121121 targetMatch = true ;
122122 } else {
123123 vscode . window . showErrorMessage ( `Couldn't attach to ${ targetUrl } .` ) ;
124124 }
125125 }
126126
127127 if ( targetMatch ) {
128- DevToolsPanel . createOrShow ( context , targetUrl as string ) ;
128+ DevToolsPanel . createOrShow ( context , targetWebsocketUrl as string ) ;
129129 } else {
130130 vscode . window . showQuickPick ( items ) . then ( ( selection ) => {
131131 if ( selection ) {
0 commit comments