@@ -12,11 +12,16 @@ import {VBox} from './Widget.js';
1212
1313const UIStrings = {
1414 /**
15- * @description Text in a dialog box in DevTools stating why remote debugging has been terminated.
15+ * @description Text in a dialog box in DevTools stating that remote debugging has been terminated.
1616 * "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
1717 * (see https://developer.chrome.com/docs/devtools/remote-debugging/).
1818 */
19- debuggingConnectionWasClosed : 'Debugging connection was closed. Reason: ' ,
19+ debuggingConnectionWasClosed : 'Debugging connection was closed' ,
20+ /**
21+ *@description Text in a dialog box in DevTools stating the reason for remote debugging being terminated.
22+ *@example {target_closed} PH1
23+ */
24+ connectionClosedReason : 'Reason: {PH1}.' ,
2025 /**
2126 * @description Text in a dialog box showing how to reconnect to DevTools when remote debugging has been terminated.
2227 * "Remote debugging" here means that DevTools on a PC is inspecting a website running on an actual mobile device
@@ -38,15 +43,15 @@ export class RemoteDebuggingTerminatedScreen extends VBox {
3843 constructor ( reason : string ) {
3944 super ( true ) ;
4045 this . registerRequiredCSS ( remoteDebuggingTerminatedScreenStyles ) ;
41- const message = this . contentElement . createChild ( 'div' , 'message' ) ;
42- const span = message . createChild ( 'span ' ) ;
43- span . append ( i18nString ( UIStrings . debuggingConnectionWasClosed ) ) ;
44- const reasonElement = span . createChild ( 'span' , ' reason' ) ;
45- reasonElement . textContent = reason ;
46- this . contentElement . createChild ( 'div' , 'message' ) . textContent = i18nString ( UIStrings . reconnectWhenReadyByReopening ) ;
46+ this . contentElement . createChild ( 'div' , 'header' ) . textContent = i18nString ( UIStrings . debuggingConnectionWasClosed ) ;
47+ const contentContainer = this . contentElement . createChild ( 'div' , 'content ') ;
48+ contentContainer . createChild ( 'div' , 'reason' ) . textContent =
49+ i18nString ( UIStrings . connectionClosedReason , { PH1 : reason } ) ;
50+ contentContainer . createChild ( 'div' , 'message' ) . textContent = i18nString ( UIStrings . reconnectWhenReadyByReopening ) ;
51+ const buttonContainer = this . contentElement . createChild ( 'div' , 'button-container' ) ;
4752 const button = createTextButton (
4853 i18nString ( UIStrings . reconnectDevtools ) , ( ) => window . location . reload ( ) , { jslogContext : 'reconnect' } ) ;
49- this . contentElement . createChild ( 'div' , 'button' ) . appendChild ( button ) ;
54+ buttonContainer . createChild ( 'div' , 'button' ) . appendChild ( button ) ;
5055 }
5156
5257 static show ( reason : string ) : void {
0 commit comments