Skip to content

Commit

Permalink
Don't create global variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
tapio committed Jan 7, 2015
1 parent e56691d commit 90d59a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions injected.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
}
}
}
protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://';
address = protocol + window.location.host + window.location.pathname + '/ws';
socket = new WebSocket(address);
var protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://';
var address = protocol + window.location.host + window.location.pathname + '/ws';
var socket = new WebSocket(address);
socket.onmessage = function(msg) {
if (msg.data == 'reload') window.location.reload()
else if (msg.data == 'refreshcss') refreshCSS();
};
console.log('Live reload enabled.');
};
console.log('Live reload enabled.');
})();
</script>

0 comments on commit 90d59a7

Please sign in to comment.