<script>
const socket = new WebSocket('ws://' + location.host + '/warm-reload');
const cb = ev => {
const originalLocation = window.location.href;
setTimeout(() => {
if (window.location === originalLocation) {
window.location.reload();
}
}, 500);
};
socket.onerror = cb;
socket.onclose = cb;
</script>