@@ -20,14 +20,13 @@ const UIStrings = {
2020 /**
2121 *@description Text on the remote debugging window to indicate the connection to corresponding device was lost
2222 */
23- websocketDisconnectedConnectionLost : 'Connection lost to corresponding device'
23+ websocketDisconnectedConnectionLost : 'Connection lost to corresponding device.' ,
24+ /**
25+ *@description Text on the remote debugging window to indicate a disconnection happened because a new dev tools instance was opened
26+ */
27+ websocketDisconnectedNewDebuggerOpened : 'Disconnected due to opening a new DevTools window for the same app.'
2428} ;
2529
26- const DisconnectedReasonsUIStrings = {
27- UREGISTERED_DEVICE : UIStrings . websocketDisconnectedUnregisteredDevice ,
28- CONNECTION_LOST : UIStrings . websocketDisconnectedConnectionLost
29- }
30-
3130const str_ = i18n . i18n . registerUIStrings ( 'ui/legacy/components/utils/TargetDetachedDialog.ts' , UIStrings ) ;
3231const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
3332export class TargetDetachedDialog extends SDK . SDKModel . SDKModel < void > implements ProtocolProxyApi . InspectorDispatcher {
@@ -53,11 +52,15 @@ export class TargetDetachedDialog extends SDK.SDKModel.SDKModel<void> implements
5352 }
5453
5554 if ( connectionLostDetails . code === "1011" && connectionLostDetails . reason ?. includes ( '[UREGISTERED_DEVICE]' ) ) {
56- return i18nString ( DisconnectedReasonsUIStrings . UREGISTERED_DEVICE ) ;
55+ return i18nString ( UIStrings . websocketDisconnectedUnregisteredDevice ) ;
5756 }
5857
5958 if ( connectionLostDetails . code === "1000" && connectionLostDetails . reason ?. includes ( '[CONNECTION_LOST]' ) ) {
60- return i18nString ( DisconnectedReasonsUIStrings . CONNECTION_LOST ) ;
59+ return i18nString ( UIStrings . websocketDisconnectedConnectionLost ) ;
60+ }
61+
62+ if ( connectionLostDetails . code === "1000" && connectionLostDetails . reason ?. includes ( '[NEW_DEBUGGER_OPENED]' ) ) {
63+ return i18nString ( UIStrings . websocketDisconnectedNewDebuggerOpened ) ;
6164 }
6265
6366 return null ;
0 commit comments