fixed 昼夜切换模式逻辑
This commit is contained in:
1 parent
dd642782b4
commit
78d7d58afa
2 files changed
+39
No files matched your search
@@ -260,8 +260,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否为移动端
|
||||
function isMobile() {
|
||||
if (window.innerWidth < 768) {
|
||||
return true;
|
||||
}
|
||||
return window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
|
||||
}
|
||||
|
||||
// 加载弹幕主函数
|
||||
async function loadBarrager() {
|
||||
// 移动端不加载弹幕
|
||||
if (isMobile()) {
|
||||
console.log('[Barrage] 移动端已禁用弹幕');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const commentsData = await initArtalkAndGetComments();
|
||||
if (commentsData) {
|
||||
|
||||
Reference in new issue
Block a user