mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
25 lines
675 B
JavaScript
25 lines
675 B
JavaScript
(() =>
|
|
{
|
|
return (settings, resources) =>
|
|
{
|
|
async function setCheckState(selector, value)
|
|
{
|
|
const checkbox = await SpinQuery.condition(
|
|
() => document.querySelector(selector),
|
|
it => it !== null);
|
|
if (!checkbox)
|
|
{
|
|
return;
|
|
}
|
|
checkbox.checked = value;
|
|
raiseEvent(checkbox, "change");
|
|
}
|
|
const selectors = {
|
|
enableDanmaku: ".bilibili-player-video-danmaku-switch>input",
|
|
};
|
|
if (!settings.enableDanmaku)
|
|
{
|
|
setCheckState(selectors.enableDanmaku, false);
|
|
}
|
|
};
|
|
})(); |