diff --git a/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts b/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts index 8b29ae0edb17..9c2b2696009b 100644 --- a/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +++ b/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts @@ -25,7 +25,12 @@ const UIStrings = { /** *@description Text on the remote debugging window to indicate a disconnection happened because a second dev tools instance was opened */ - websocketDisconnectedNewDebuggerOpened: 'Disconnected due to opening a second DevTools window for the same app.' + websocketDisconnectedNewDebuggerOpened: 'Disconnected due to opening a second DevTools window for the same app.', + /** + *@description Text on the remote debugging window to indicate the React Native instance being debugged was destroyed + */ + websocketDisconnectedPageRemoved: + 'The React Native instance being debugged no longer exists. Relaunch DevTools to debug a new instance.', } as const; const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/utils/TargetDetachedDialog.ts', UIStrings); @@ -64,6 +69,10 @@ export class TargetDetachedDialog extends SDK.SDKModel.SDKModel implements return i18nString(UIStrings.websocketDisconnectedNewDebuggerOpened); } + if (connectionLostDetails.code === '1000' && connectionLostDetails.reason?.includes('[PAGE_REMOVED]')) { + return i18nString(UIStrings.websocketDisconnectedPageRemoved); + } + return null; }