@@ -25,6 +25,12 @@ const UIStrings = {
2525 * (see https://developer.chrome.com/docs/devtools/remote-debugging/).
2626 */
2727 debuggingConnectionWasClosed : 'Debugging connection was closed. Reason: ' ,
28+ /**
29+ * @description Text in a dialog box in DevTools providing extra details on why remote debugging has been terminated.
30+ * "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
31+ * (see https://developer.chrome.com/docs/devtools/remote-debugging/).
32+ */
33+ debuggingConnectionWasClosedDetails : 'Details: ' ,
2834 /**
2935 * @description Text in a dialog box showing how to reconnect to DevTools when remote debugging has been terminated.
3036 * "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
@@ -68,7 +74,11 @@ const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
6874const { render, html} = LitHtml ;
6975
7076export class RemoteDebuggingTerminatedScreen extends VBox {
71- constructor ( reason : string , onClose ?: ( ) => void ) {
77+ constructor (
78+ reason : string ,
79+ connectionLostDetails ?: { reason ?: string , code ?: string , errorType ?: string } ,
80+ onClose ?: ( ) => void
81+ ) {
7282 super ( true ) ;
7383 this . registerCSSFiles ( [ remoteDebuggingTerminatedScreenStyles ] ) ;
7484
@@ -81,21 +91,28 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
8191 html `
8292 < h1 class ="remote-debugging-terminated-title "> ${ i18nString ( UIStrings . title ) } </ h1 >
8393 < div class ="remote-debugging-terminated-message ">
84- < span > ${ i18nString ( UIStrings . debuggingConnectionWasClosed ) } </ span >
85- < br />
86- < span class ="remote-debugging-terminated-reason "> ${ reason } </ span >
94+ < div > ${ i18nString ( UIStrings . debuggingConnectionWasClosed ) } </ div >
95+ < div class ="remote-debugging-terminated-reason "> ${ reason } </ div >
96+ ${ globalThis . enableDisplayingFullDisconnectedReason ?
97+ html `
98+ < div >
99+ ${ i18nString ( UIStrings . debuggingConnectionWasClosedDetails ) }
100+ </ div >
101+ < div class ="remote-debugging-terminated-reason ">
102+ < textarea disabled rows ="5 "> ${ JSON . stringify ( connectionLostDetails , null , 2 ) } </ textarea >
103+ </ div >
104+ ` : '' }
87105 </ div >
88106 ${ feedbackLink !== null && feedbackLink !== undefined ? this . #createFeedbackSection( feedbackLink ) : null }
89107 < div class ="remote-debugging-terminated-options ">
90108 < div class ="remote-debugging-terminated-label ">
91109 ${ i18nString ( UIStrings . reconnectWhenReadyByReopening ) }
92110 </ div >
93- ${
94- createTextButton (
95- i18nString ( UIStrings . reconnectDevtools ) ,
96- handleReconnect ,
97- { className : 'primary-button' , jslogContext : 'reconnect' } ,
98- ) }
111+ ${ createTextButton (
112+ i18nString ( UIStrings . reconnectDevtools ) ,
113+ handleReconnect ,
114+ { className : 'primary-button' , jslogContext : 'reconnect' } ,
115+ ) }
99116 < div class ="remote-debugging-terminated-label ">
100117 ${ i18nString ( UIStrings . closeDialogDetail ) }
101118 </ div >
@@ -116,7 +133,7 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
116133 const dialog = new Dialog ( 'remote-debnugging-terminated' ) ;
117134 dialog . setSizeBehavior ( SizeBehavior . MeasureContent ) ;
118135 dialog . setDimmed ( true ) ;
119- new RemoteDebuggingTerminatedScreen ( uiMessage , ( ) => dialog . hide ( ) ) . show ( dialog . contentElement ) ;
136+ new RemoteDebuggingTerminatedScreen ( uiMessage , connectionLostDetails , ( ) => dialog . hide ( ) ) . show ( dialog . contentElement ) ;
120137 dialog . show ( ) ;
121138 Host . rnPerfMetrics . remoteDebuggingTerminated ( connectionLostDetails ) ;
122139 }
0 commit comments