@@ -328,9 +328,9 @@ SDK.TargetManager = class extends Common.Object {
328
328
_connectAndCreateMainTarget ( ) {
329
329
if ( Runtime . queryParam ( 'nodeFrontend' ) ) {
330
330
var target = new SDK . Target (
331
- this , 'main' , Common . UIString ( 'Node' ) , SDK . Target . Capability . Target , this . _createMainConnection . bind ( this ) ,
331
+ this , 'main' , Common . UIString ( 'Node.js ' ) , SDK . Target . Capability . Target , this . _createMainConnection . bind ( this ) ,
332
332
null ) ;
333
- target . setInspectedURL ( 'Node' ) ;
333
+ target . setInspectedURL ( 'Node.js ' ) ;
334
334
this . _childTargetManagers . set ( target , new SDK . ChildTargetManager ( this , target ) ) ;
335
335
Host . userMetrics . actionTaken ( Host . UserMetrics . Action . ConnectToNodeJSFromFrontend ) ;
336
336
return ;
@@ -410,13 +410,15 @@ SDK.ChildTargetManager = class {
410
410
if ( Runtime . experiments . isEnabled ( 'autoAttachToCrossProcessSubframes' ) )
411
411
this . _targetAgent . setAttachToFrames ( true ) ;
412
412
413
- if ( ! parentTarget . parentTarget ( ) )
413
+ if ( ! parentTarget . parentTarget ( ) ) {
414
414
this . _targetAgent . setDiscoverTargets ( true ) ;
415
-
416
- if ( Runtime . queryParam ( 'nodeFrontend' ) && ! this . _parentTarget . parentTarget ( ) ) {
417
- InspectorFrontendHost . setDevicesUpdatesEnabled ( true ) ;
418
- InspectorFrontendHost . events . addEventListener (
419
- InspectorFrontendHostAPI . Events . DevicesDiscoveryConfigChanged , this . _devicesDiscoveryConfigChanged , this ) ;
415
+ if ( Runtime . queryParam ( 'nodeFrontend' ) ) {
416
+ InspectorFrontendHost . setDevicesUpdatesEnabled ( true ) ;
417
+ InspectorFrontendHost . events . addEventListener (
418
+ InspectorFrontendHostAPI . Events . DevicesDiscoveryConfigChanged , this . _devicesDiscoveryConfigChanged , this ) ;
419
+ } else {
420
+ this . _targetAgent . setRemoteLocations ( [ { host : 'localhost' , port : 9229 } ] ) ;
421
+ }
420
422
}
421
423
}
422
424
@@ -429,7 +431,8 @@ SDK.ChildTargetManager = class {
429
431
for ( var address of config . networkDiscoveryConfig ) {
430
432
var parts = address . split ( ':' ) ;
431
433
var port = parseInt ( parts [ 1 ] , 10 ) ;
432
- locations . push ( { host : parts [ 0 ] || 'localhost' , port : port || 9229 } ) ;
434
+ if ( parts [ 0 ] && port )
435
+ locations . push ( { host : parts [ 0 ] , port : port } ) ;
433
436
}
434
437
this . _targetAgent . setRemoteLocations ( locations ) ;
435
438
}
@@ -513,7 +516,7 @@ SDK.ChildTargetManager = class {
513
516
attachedToTarget ( targetInfo , waitingForDebugger ) {
514
517
var targetName = '' ;
515
518
if ( targetInfo . type === 'node' ) {
516
- targetName = Common . UIString ( 'Node: %s' , targetInfo . url ) ;
519
+ targetName = Common . UIString ( 'Node.js : %s' , targetInfo . url ) ;
517
520
} else if ( targetInfo . type !== 'iframe' ) {
518
521
var parsedURL = targetInfo . url . asParsedURL ( ) ;
519
522
targetName =
0 commit comments