1/* eslint-env browser */ 2// Setup websocket messages for reloading the page from the command line. 3// This is normally setup on the native client. 4const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws'; 5const messageSocket = new WebSocket(`${protocol}://${window.location.host}/message`); 6messageSocket.onmessage = (message) => { 7 const data = JSON.parse(String(message.data)); 8 switch (data.method) { 9 case 'sendDevCommand': 10 switch (data.params.name) { 11 case 'reload': 12 window.location.reload(); 13 break; 14 } 15 break; 16 case 'reload': 17 window.location.reload(); 18 break; 19 case 'devMenu': 20 // no-op 21 break; 22 } 23}; 24//# sourceMappingURL=messageSocket.js.map