Add fallback for ass danmakus

This commit is contained in:
the1812 2019-01-26 15:43:53 +08:00
parent e7d0d0c95e
commit e86f479f54
4 changed files with 22 additions and 10 deletions

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name Bilibili Evolved (Offline) // @name Bilibili Evolved (Offline)
// @version 193.99 // @version 194.00
// @description Bilibili Evolved 的离线版, 所有功能都已内置于脚本中. // @description Bilibili Evolved 的离线版, 所有功能都已内置于脚本中.
// @author Grant Howard, Coulomb-G // @author Grant Howard, Coulomb-G
// @copyright 2019, Grant Howrad (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) // @copyright 2019, Grant Howrad (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -774,8 +774,11 @@
} }
async function loadLazyPanel(selector) async function loadLazyPanel(selector)
{ {
await SpinQuery.unsafeJquery(); const panel = unsafeWindow.$(selector);
const panel = await SpinQuery.any(() => unsafeWindow.$(selector)); if (panel.length === 0)
{
throw new Error(`Panel not found:${selector}`);
}
panel.mouseover().mouseout(); panel.mouseover().mouseout();
} }
function contentLoaded(callback) function contentLoaded(callback)

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name Bilibili Evolved (Preview Offline) // @name Bilibili Evolved (Preview Offline)
// @version 193.99 // @version 194.00
// @description Bilibili Evolved 的预览离线版, 可以抢先体验新功能, 并且所有功能都已内置于脚本中. // @description Bilibili Evolved 的预览离线版, 可以抢先体验新功能, 并且所有功能都已内置于脚本中.
// @author Grant Howard, Coulomb-G // @author Grant Howard, Coulomb-G
// @copyright 2019, Grant Howrad (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G) // @copyright 2019, Grant Howrad (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)
@ -774,8 +774,11 @@
} }
async function loadLazyPanel(selector) async function loadLazyPanel(selector)
{ {
await SpinQuery.unsafeJquery(); const panel = unsafeWindow.$(selector);
const panel = await SpinQuery.any(() => unsafeWindow.$(selector)); if (panel.length === 0)
{
throw new Error(`Panel not found:${selector}`);
}
panel.mouseover().mouseout(); panel.mouseover().mouseout();
} }
function contentLoaded(callback) function contentLoaded(callback)

View File

@ -773,8 +773,11 @@
} }
async function loadLazyPanel(selector) async function loadLazyPanel(selector)
{ {
await SpinQuery.unsafeJquery(); const panel = unsafeWindow.$(selector);
const panel = await SpinQuery.any(() => unsafeWindow.$(selector)); if (panel.length === 0)
{
throw new Error(`Panel not found:${selector}`);
}
panel.mouseover().mouseout(); panel.mouseover().mouseout();
} }
function contentLoaded(callback) function contentLoaded(callback)

View File

@ -773,8 +773,11 @@
} }
async function loadLazyPanel(selector) async function loadLazyPanel(selector)
{ {
await SpinQuery.unsafeJquery(); const panel = unsafeWindow.$(selector);
const panel = await SpinQuery.any(() => unsafeWindow.$(selector)); if (panel.length === 0)
{
throw new Error(`Panel not found:${selector}`);
}
panel.mouseover().mouseout(); panel.mouseover().mouseout();
} }
function contentLoaded(callback) function contentLoaded(callback)