File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 106
106
cursorBlink : false
107
107
} ) ;
108
108
term . open ( document . getElementById ( "term" ) ) ;
109
+ show_https_warning ( ) ;
109
110
} ;
110
111
window . addEventListener ( 'resize' , function ( ) {
111
112
var size = calculate_size ( self ) ;
112
113
term . resize ( size [ 0 ] , size [ 1 ] ) ;
113
114
} ) ;
114
115
} ) . call ( this ) ;
115
116
117
+ function show_https_warning ( ) {
118
+ if ( window . location . protocol == 'https:' ) {
119
+ var warningDiv = document . createElement ( 'div' ) ;
120
+ warningDiv . style . cssText = 'background:#f99;padding:5px;margin-bottom:10px;line-height:1.5em;text-align:center' ;
121
+ warningDiv . innerHTML = [
122
+ 'At this time, the WebREPL client cannot be accessed over HTTPS connections.' ,
123
+ 'Use a HTTP connection, eg. <a href="http://micropython.org/webrepl/">http://micropython.org/webrepl/</a>.' ,
124
+ 'Alternatively, download the files from <a href="https://github.com/micropython/webrepl">GitHub</a> and run them locally.'
125
+ ] . join ( '<br>' ) ;
126
+ document . body . insertBefore ( warningDiv , document . body . childNodes [ 0 ] ) ;
127
+ term . resize ( term . cols , term . rows - 7 ) ;
128
+ }
129
+ }
130
+
116
131
function button_click ( ) {
117
132
if ( connected ) {
118
133
ws . close ( ) ;
You can’t perform that action at this time.
0 commit comments