mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-13 07:46:17 -08:00
add isLocalhost
This commit is contained in:
1 parent
8ad6550d12
commit
6f84fcc8f2
2 files changed
+33
-12
No files matched your search
+8
-1
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user