mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix bug in Observer
This commit is contained in:
parent
4073ff041c
commit
be67e5a536
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Bilibili Evolved (Preview)
|
// @name Bilibili Evolved (Preview)
|
||||||
// @version 1.5.36
|
// @version 1.5.37
|
||||||
// @description 增强哔哩哔哩Web端体验(预览版分支): 修复界面瑕疵, 删除广告, 使用夜间模式浏览, 下载视频或视频封面, 以及增加对触屏设备的支持等.
|
// @description 增强哔哩哔哩Web端体验(预览版分支): 修复界面瑕疵, 删除广告, 使用夜间模式浏览, 下载视频或视频封面, 以及增加对触屏设备的支持等.
|
||||||
// @author Grant Howard, Coulomb-G
|
// @author Grant Howard, Coulomb-G
|
||||||
// @copyright 2018, Grant Howrad (https://github.com/the1812)
|
// @copyright 2018, Grant Howrad (https://github.com/the1812)
|
||||||
@ -567,7 +567,7 @@
|
|||||||
this.element = element;
|
this.element = element;
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.observer = null;
|
this.observer = null;
|
||||||
this.options = { childList: true, subtree: true, };
|
this.options = undefined;
|
||||||
}
|
}
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
@ -589,7 +589,13 @@
|
|||||||
return [...document.querySelectorAll(selector)].map(
|
return [...document.querySelectorAll(selector)].map(
|
||||||
it =>
|
it =>
|
||||||
{
|
{
|
||||||
return new Observer(it, callback).start();
|
const observer = new Observer(it, callback);
|
||||||
|
observer.options = {
|
||||||
|
childList: true,
|
||||||
|
subtree: false,
|
||||||
|
attributes: false,
|
||||||
|
};
|
||||||
|
return observer.start();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static attributes(selector, callback)
|
static attributes(selector, callback)
|
||||||
@ -601,7 +607,7 @@
|
|||||||
const observer = new Observer(it, callback);
|
const observer = new Observer(it, callback);
|
||||||
observer.options = {
|
observer.options = {
|
||||||
childList: false,
|
childList: false,
|
||||||
subtree: false,
|
subtree: true,
|
||||||
attributes: true,
|
attributes: true,
|
||||||
};
|
};
|
||||||
return observer.start();
|
return observer.start();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user