Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Get the like number from proper place
Browse files Browse the repository at this point in the history
When like button is clicked, only one of the two aria-label attributes gets updated. Use the correct one to reflect latest like count. Affects user option "re-format like numbers"

Attn Anarios#561
  • Loading branch information
cyrildtm committed May 8, 2022
1 parent 17c9af1 commit df742d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Extensions/combined/src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function getLikeCountFromButton() {
return 0;
}
let likesStr = getLikeButton()
.querySelector("button")
.querySelector("yt-formatted-string#text")
.getAttribute("aria-label")
.replace(/\D/g, "");
return likesStr.length > 0 ? parseInt(likesStr) : false;
Expand Down

0 comments on commit df742d0

Please # to comment.