CKAutoLoader

[已弃用] CKAutoLoader用于在哔哩哔哩播放器页面延后加载脚本,参考了Pakku弹幕插件的加载方式。

Questo script non dovrebbe essere installato direttamente. È una libreria per altri script da includere con la chiave // @require https://update.greasyfork.org/scripts/405344/1027351/CKAutoLoader.js

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Autore
CKylinMC
Versione
0.2
Creato il
15/06/2020
Aggiornato il
08/08/2020
Dimensione
3,94 KB
Licenza
GPLv3 License

此脚本已弃用,请使用CKTools中的await CKTools.bili.playerReady()方法。


CKAutoLoader用于在哔哩哔哩播放器页面延后加载脚本,参考了Pakku弹幕插件的加载方式。

旧版本:https://greasyfork.org/scripts/405344-ckautoloader/code/CKAutoLoader.js?version=816331

使用方法:

注册回调式

在播放器区域加载完成后自动调用。

将回调方法传入CKAutoLoader,并被自动调用。

window.CKAutoLoader.reg("回调标识", 回调方法);
  • 回调标识(string):一个在出错时显示的名字
  • 回调方法(function):播放器加载完成后执行的方法

使用reg方法后会自动开始检测播放器加载。

全局事件式(v0.2+)

支持两种事件:

  • ckBilibiliPlayerLoaded 播放器加载完成。
    • 此事件机制等同于注册回调式,但是为了避免出错,先于回调触发。
  • ckBilibiliCommentLoaded 评论区加载完成。
    • 此事件仅在视频页面测试完成,为事件独有的检测。
    • 注册回调时也会开始检测评论区,但是只接受事件,没有单独的回调注册。
window.CKAutoLoader.start();
window.addEventListener("事件名称", 回调方法);

注册事件前需要先使用start方法开始检测。