11<!DOCTYPE html>
22< html lang ="en ">
3+
34< head >
45 < meta charset ="UTF-8 ">
56 < meta http-equiv ="X-UA-Compatible " content ="IE=edge,chrome=1 ">
67 < meta name ="mobile-web-app-capable " content ="yes ">
7- < title > < %= htmlWebpackPlugin.options.title %> </ title >
8+ < title >
9+ < %= htmlWebpackPlugin.options.title %>
10+ </ title >
811 < link inline rel ="icon " type ="image/png " href ="favicon.png ">
912 < % for (const css in htmlWebpackPlugin.files.css) { %>
10- < link inline rel ="stylesheet " type ="text/css " href ="<%= htmlWebpackPlugin.files.css[css] %> ">
11- < % } %>
13+ < link inline rel ="stylesheet " type ="text/css " href ="<%= htmlWebpackPlugin.files.css[css] %> ">
14+ < % } %>
1215</ head >
16+
1317< body >
14- < script type ="text/javascript ">
15- window . addEventListener ( 'custom:ttydReady' , ( event ) => {
16- window . parent . postMessage ( { ttyd : 'ready' } , '*' )
18+ < script type ="text/javascript ">
19+ window . addEventListener ( 'custom:ttydReady' , ( event ) => {
20+ console . log ( '[ttyd] custom:ttydReady event received' )
21+ window . parent . postMessage ( { ttyd : 'ready' } , '*' )
1722
18- } )
19- window . addEventListener ( "message" , ( e ) => {
20- try {
21- if ( e . data . command ) {
22- window . term . paste ( e . data . command )
23- document . querySelector ( "textarea.xterm-helper-textarea" ) . dispatchEvent ( new KeyboardEvent ( 'keypress' , { charCode : 13 } ) )
23+ } )
24+ window . addEventListener ( "message" , ( e ) => {
25+ console . log ( '[ttyd] message event received' , e )
26+ try {
27+ if ( e . data . command ) {
28+ window . term . paste ( e . data . command )
29+ document . querySelector ( "textarea.xterm-helper-textarea" ) . dispatchEvent ( new KeyboardEvent ( 'keypress' , { charCode : 13 } ) )
30+ }
31+ } catch ( error ) {
32+ window . parent . postMessage ( { ttyd : "error" } , "*" )
2433 }
25- } catch ( error ) {
26- window . parent . postMessage ( { ttyd : "error" } , "*" )
27- }
28- } )
29- </ script >
30- < % for (const js in htmlWebpackPlugin.files.js) { %>
31- < script inline type ="text/javascript " src ="<%= htmlWebpackPlugin.files.js[js] %> "> </ script >
32- < % } %>
34+ } )
35+ </ script >
36+ < % for (const js in htmlWebpackPlugin.files.js) { %>
37+ < script inline type ="text/javascript " src ="<%= htmlWebpackPlugin.files.js[js] %> "> </ script >
38+ < % } %>
3339</ body >
34- </ html >
40+
41+ </ html >
0 commit comments