mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-12-02 10:52:20 +01:00
fix #232
This commit is contained in:
1 parent
593c670199
commit
904760ea62
1 file changed
+15
@@ -85,6 +85,17 @@ function isVideoNotDisliked() {
|
|||||||
return getDislikeButton().classList.contains("style-text");
|
return getDislikeButton().classList.contains("style-text");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkForSignInButton() {
|
||||||
|
if (isMobile) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (document.querySelector('[aria-label="Sign in"]')) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getState() {
|
function getState() {
|
||||||
if (isVideoLiked()) {
|
if (isVideoLiked()) {
|
||||||
return LIKED_STATE;
|
return LIKED_STATE;
|
||||||
@@ -260,6 +271,7 @@ function setState() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function likeClicked() {
|
function likeClicked() {
|
||||||
|
if (checkForSignInButton() == false) {
|
||||||
if (previousState == 1) {
|
if (previousState == 1) {
|
||||||
likesvalue--;
|
likesvalue--;
|
||||||
createRateBar(likesvalue, dislikesvalue);
|
createRateBar(likesvalue, dislikesvalue);
|
||||||
@@ -277,8 +289,10 @@ function likeClicked() {
|
|||||||
previousState = 1
|
previousState = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function dislikeClicked() {
|
function dislikeClicked() {
|
||||||
|
if (checkForSignInButton() == false) {
|
||||||
if (previousState == 3) {
|
if (previousState == 3) {
|
||||||
dislikesvalue++;
|
dislikesvalue++;
|
||||||
setDislikes(numberFormat(dislikesvalue));
|
setDislikes(numberFormat(dislikesvalue));
|
||||||
@@ -296,6 +310,7 @@ function dislikeClicked() {
|
|||||||
createRateBar(likesvalue, dislikesvalue);
|
createRateBar(likesvalue, dislikesvalue);
|
||||||
previousState = 2
|
previousState = 2
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setInitialState() {
|
function setInitialState() {
|
||||||
|
|||||||
Reference in new issue
Block a user