sS hSilentComputator() { int port = subBot_currentPort(); ret div("Calculating", id := 'calcing) + hcss([[#calcing { position: fixed; width: 100%; height: 100vh; z-index: 9999; visibility: hidden; }]]) + hjavascript_src_snippet(#1013374) // ReconnectingWebSocket + hjavascript(replaceIf(subBot_isHttps(), "ws://", "wss://", [[ function sendPing() { ${PINGCMD} } var working = true /*XXX false*/; var ws = new ReconnectingWebSocket("ws://${DOMAIN}/"); ws.onmessage = function(event) { var d = event.data; while (d.length > 0 && d.charCodeAt(d.length-1) == 0) d = d.substring(0, d.length-1); console.log("Evaluating: " + d); eval(d); console.log("Evaluated."); }; working = true; console.log("Eval test: " + eval('working')); working = false; ]].replace("${DOMAIN}", domain() + (port == 80 ? "" : ":" + port)) .replace("${PINGCMD}", nodes_pingCmd()))); }