diff --git a/bilibili-evolved.offline.user.js b/bilibili-evolved.offline.user.js index c289fc39f..e6fa0aa9b 100644 --- a/bilibili-evolved.offline.user.js +++ b/bilibili-evolved.offline.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Bilibili Evolved (Offline) -// @version 238.23 +// @version 238.24 // @description Bilibili Evolved 的离线版, 所有功能都已内置于脚本中. // @author Grant Howard, Coulomb-G // @copyright 2019, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) @@ -1048,10 +1048,9 @@ class Observer { return null; } - callback([]); return Observer.childList("#bofqi,#bilibiliPlayer", records => { - const isMenuAttached = records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); + const isMenuAttached = records.length > 0 && records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); if (!isMenuAttached) { callback(records); diff --git a/bilibili-evolved.preview-offline.user.js b/bilibili-evolved.preview-offline.user.js index 1212d012f..4e707f802 100644 --- a/bilibili-evolved.preview-offline.user.js +++ b/bilibili-evolved.preview-offline.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name Bilibili Evolved (Preview Offline) -// @version 238.23 +// @version 238.24 // @description Bilibili Evolved 的预览离线版, 可以抢先体验新功能, 并且所有功能都已内置于脚本中. // @author Grant Howard, Coulomb-G // @copyright 2019, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) @@ -1048,10 +1048,9 @@ class Observer { return null; } - callback([]); return Observer.childList("#bofqi,#bilibiliPlayer", records => { - const isMenuAttached = records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); + const isMenuAttached = records.length > 0 && records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); if (!isMenuAttached) { callback(records); diff --git a/bilibili-evolved.preview.user.js b/bilibili-evolved.preview.user.js index 1cf3cc62a..351d42859 100644 --- a/bilibili-evolved.preview.user.js +++ b/bilibili-evolved.preview.user.js @@ -1047,10 +1047,9 @@ class Observer { return null; } - callback([]); return Observer.childList("#bofqi,#bilibiliPlayer", records => { - const isMenuAttached = records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); + const isMenuAttached = records.length > 0 && records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); if (!isMenuAttached) { callback(records); diff --git a/bilibili-evolved.user.js b/bilibili-evolved.user.js index db179574a..3c4244b2a 100644 --- a/bilibili-evolved.user.js +++ b/bilibili-evolved.user.js @@ -1047,10 +1047,9 @@ class Observer { return null; } - callback([]); return Observer.childList("#bofqi,#bilibiliPlayer", records => { - const isMenuAttached = records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); + const isMenuAttached = records.length > 0 && records.every(it => [...it.addedNodes].some(e => e.classList.contains("bilibili-player-context-menu-container"))); if (!isMenuAttached) { callback(records);