Fix bug in videoChange

This commit is contained in:
the1812 2019-03-11 21:35:41 +08:00
parent b48bd05d32
commit a8ffa0bc65
4 changed files with 6 additions and 10 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);