reloadOn function
Generates a JavaScript which will reload the browser on receiving a message
from webSocketUri
.
Implementation
String reloadOn(Uri webSocketUri, String message) => "(function(){"
"var a=new WebSocket('$webSocketUri');"
"a.onmessage=function(e){if(e.data==='$message')window.location.reload()};"
"window.onunload=function(e){a.send('$disconnectSignal')};"
"})();";