I've been trying to use socket.io for a chrome extension to implement multi userability but socket.io requires inline HTML scrips which chrome extensions don't take. Is there anyway to potentially get that to work.
EX:
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io();
var form = document.getElementById('form');
var input = document.getElementById('input');
form.addEventListener('submit', function(e) {
e.preventDefault();
if (input.value) {
socket.emit('chat message', input.value);
input.value = '';
}
});
</script>
How could I use this without needing inline HTML. Along with not using require as that doesn't work to import in a chrome extension.