add isLocalhost

This commit is contained in:
Harvey committed 2019-09-27 10:06:18 +08:00
1 parent 8ad6550d12
commit 6f84fcc8f2
2 files changed
+33 -12

No files matched your search

+8 -1
View File
@@ -22,9 +22,16 @@
<script src="./uncompiled/artplayer.js"></script>
<script src="./assets/js/mobile.js"></script>
<script>
var isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
window.location.hostname === '[::1]' ||
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
var _hmt = _hmt || [];
(function () {
if (window.location.hostname !== 'localhost') {
if (!isLocalhost) {
var hm = document.createElement('script');
hm.src = 'https://hm.baidu.com/hm.js?b6c9b8bafbf5fe7225160101dafbbc7d';
var s = document.getElementsByTagName('script')[0];