<!DOCTYPE html>
<html>
<head>
    <title>Mocha</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="mocha.css" />
</head>
<body>
    <div id="mocha"></div>
    <div id="el-js"></div>
    <script src="mocha.js"></script>
    <script>mocha.setup('bdd');</script>
    <script src="suite.js"></script>
    <script>
        mocha.run();
    </script>
    <script>
        document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>');
    </script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
    <title>Mocha</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="mocha.css" />
</head>
<body>
    <div id="mocha"></div>
    <div id="el-js"></div>
    <script src="mocha.js"></script>
    <script>mocha.setup('bdd');</script>
    <script src="suite.js"></script>
    <script>
        mocha.run();
    </script>
    <script>
        if (location.hostname === 'localhost' || location.hostname === '127.0.0.1') {
            // Only write out the livereload snippet if we think we're in an environment where it might be available (otherwise we risk hanging e.g. Selenium runners)
            document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>');
        }
    </script>
</body>
</html>

Make the livereload snippet conditional to window.location.
Make the livereload snippet conditional to window.location.
