Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion front_end/ui/legacy/components/utils/TargetDetachedDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -64,6 +69,10 @@ export class TargetDetachedDialog extends SDK.SDKModel.SDKModel<void> implements
return i18nString(UIStrings.websocketDisconnectedNewDebuggerOpened);
}

if (connectionLostDetails.code === '1000' && connectionLostDetails.reason?.includes('[PAGE_REMOVED]')) {
return i18nString(UIStrings.websocketDisconnectedPageRemoved);
}

return null;
}

Expand Down
Loading