@@ -20,14 +20,13 @@ const UIStrings = {
20
20
/**
21
21
*@description Text on the remote debugging window to indicate the connection to corresponding device was lost
22
22
*/
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 second dev tools instance was opened
26
+ */
27
+ websocketDisconnectedNewDebuggerOpened : 'Disconnected due to opening a second DevTools window for the same app.'
24
28
} ;
25
29
26
- const DisconnectedReasonsUIStrings = {
27
- UREGISTERED_DEVICE : UIStrings . websocketDisconnectedUnregisteredDevice ,
28
- CONNECTION_LOST : UIStrings . websocketDisconnectedConnectionLost
29
- }
30
-
31
30
const str_ = i18n . i18n . registerUIStrings ( 'ui/legacy/components/utils/TargetDetachedDialog.ts' , UIStrings ) ;
32
31
const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
33
32
export class TargetDetachedDialog extends SDK . SDKModel . SDKModel < void > implements ProtocolProxyApi . InspectorDispatcher {
@@ -53,11 +52,15 @@ export class TargetDetachedDialog extends SDK.SDKModel.SDKModel<void> implements
53
52
}
54
53
55
54
if ( connectionLostDetails . code === "1011" && connectionLostDetails . reason ?. includes ( '[UREGISTERED_DEVICE]' ) ) {
56
- return i18nString ( DisconnectedReasonsUIStrings . UREGISTERED_DEVICE ) ;
55
+ return i18nString ( UIStrings . websocketDisconnectedUnregisteredDevice ) ;
57
56
}
58
57
59
58
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 ) ;
61
64
}
62
65
63
66
return null ;
0 commit comments