const fs = require('fs');
let html = fs.readFileSync('index.html', 'utf8');
if (!html.includes('error_logger.js')) {
    html = html.replace(/<head>/i, '<head><script src="error_logger.js?v=' + Date.now() + '"></script>');
    fs.writeFileSync('index.html', html, 'utf8');
    console.log('Injected error_logger.js');
} else {
    console.log('Already injected');
}
