mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-23 06:43:02 +01:00
Unobserved child node removals (#1096)
* fix(userscript): listen to node removals * fix(combined): observe node removals
This commit is contained in:
3 files changed
+19
-5
No files matched your search
@@ -258,8 +258,12 @@ function setDislikes(dislikesCount) {
|
||||
mobileDislikes = dislikesCount;
|
||||
return;
|
||||
}
|
||||
getDislikeTextContainer()?.removeAttribute("is-empty");
|
||||
getDislikeTextContainer().innerText = dislikesCount;
|
||||
|
||||
const _container = getDislikeTextContainer();
|
||||
_container?.removeAttribute("is-empty");
|
||||
if (_container?.innerText !== dislikesCount) {
|
||||
_container.innerText = dislikesCount;
|
||||
}
|
||||
}
|
||||
|
||||
function getLikeCountFromButton() {
|
||||
@@ -648,6 +652,7 @@ function setEventListeners(evt) {
|
||||
{
|
||||
attributes: true,
|
||||
subtree: true,
|
||||
childList: true,
|
||||
},
|
||||
updateDOMDislikes,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user