CKAutoLoader

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

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/405344/1027351/CKAutoLoader.js

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Autor
CKylinMC
Wersja
0.2
Utworzono
15-06-2020
Zaktualizowano
08-08-2020
Rozmiar
3,94 KB
Licencja
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方法开始检测。