diff --git a/webrepl.html b/webrepl.html index a2b8cda..f757c34 100644 --- a/webrepl.html +++ b/webrepl.html @@ -97,15 +97,19 @@ (function() { window.onload = function() { - var size = calculate_size(self); - term = new Terminal({ - cols: size[0], - rows: size[1], - useStyle: true, - screenKeys: true, - cursorBlink: false - }); - term.open(document.getElementById("term")); + var url = window.location.hash.substring(1); + if(url) { + document.getElementById('url').value = 'ws://' + url; + } + var size = calculate_size(self); + term = new Terminal({ + cols: size[0], + rows: size[1], + useStyle: true, + screenKeys: true, + cursorBlink: false + }); + term.open(document.getElementById("term")); }; window.addEventListener('resize', function() { var size = calculate_size(self); @@ -134,6 +138,7 @@ } function connect(url) { + window.location.hash = url.substring(5); ws = new WebSocket(url); ws.binaryType = 'arraybuffer'; ws.onopen = function() {