mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-22 22:33:01 +01:00
Merge branch 'Anarios:main' into main
This commit is contained in:
6 files changed
+12
-3
No files matched your search
@@ -58,6 +58,9 @@ function isInViewport(element) {
|
||||
const height = innerHeight || document.documentElement.clientHeight;
|
||||
const width = innerWidth || document.documentElement.clientWidth;
|
||||
return (
|
||||
// When short (channel) is ignored, the element (like/dislike AND short itself) is
|
||||
// hidden with a 0 DOMRect. In this case, consider it outside of Viewport
|
||||
!(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) &&
|
||||
rect.top >= 0 &&
|
||||
rect.left >= 0 &&
|
||||
rect.bottom <= height &&
|
||||
@@ -240,6 +243,7 @@ function setDislikes(dislikesCount) {
|
||||
mobileDislikes = dislikesCount;
|
||||
return;
|
||||
}
|
||||
getDislikeTextContainer()?.removeAttribute('is-empty');
|
||||
getDislikeTextContainer().innerText = dislikesCount;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDesc__",
|
||||
"default_locale": "en",
|
||||
"version": "3.0.0.4",
|
||||
"version": "3.0.0.5",
|
||||
"manifest_version": 3,
|
||||
"background": {
|
||||
"service_worker": "ryd.background.js"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "__MSG_extensionName__",
|
||||
"description": "__MSG_extensionDesc__",
|
||||
"default_locale": "en",
|
||||
"version": "3.0.0.5",
|
||||
"version": "3.0.0.6",
|
||||
"manifest_version": 2,
|
||||
"background": {
|
||||
"scripts": ["ryd.background.js"]
|
||||
|
||||
@@ -56,7 +56,8 @@ function getDislikeButton() {
|
||||
function getDislikeTextContainer() {
|
||||
let result =
|
||||
getDislikeButton().querySelector("#text") ??
|
||||
getDislikeButton().getElementsByTagName("yt-formatted-string")[0];
|
||||
getDislikeButton().getElementsByTagName("yt-formatted-string")[0] ??
|
||||
getDislikeButton().querySelector("span[role='text']");
|
||||
if (result == null) {
|
||||
let textSpan = document.createElement("span");
|
||||
textSpan.id = "text";
|
||||
|
||||
@@ -137,6 +137,7 @@ function setLikes(likesCount) {
|
||||
}
|
||||
|
||||
function setDislikes(dislikesCount) {
|
||||
getDislikeTextContainer()?.removeAttribute('is-empty');
|
||||
if (!isLikesDisabled()) {
|
||||
if (isMobile()) {
|
||||
getButtons().children[1].querySelector(
|
||||
|
||||
@@ -87,6 +87,9 @@ function isInViewport(element) {
|
||||
const height = innerHeight || document.documentElement.clientHeight;
|
||||
const width = innerWidth || document.documentElement.clientWidth;
|
||||
return (
|
||||
// When short (channel) is ignored, the element (like/dislike AND short itself) is
|
||||
// hidden with a 0 DOMRect. In this case, consider it outside of Viewport
|
||||
!(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) &&
|
||||
rect.top >= 0 &&
|
||||
rect.left >= 0 &&
|
||||
rect.bottom <= height &&
|
||||
|
||||
Reference in new issue
Block a user