mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-11-29 09:27:54 +01:00
Extensions: Supports YouTube Shorts
This commit is contained in:
1 parent
39c3b49c7c
commit
1cc579d00d
5 files changed
+43
-4
No files matched your search
@@ -1,6 +1,19 @@
|
||||
import { isMobile } from "./state";
|
||||
import { isMobile, isShorts } from "./state";
|
||||
import { isInViewport } from "./utils";
|
||||
|
||||
function getButtons() {
|
||||
//--- If Watching Youtube Shorts: ---//
|
||||
if(isShorts()) {
|
||||
let elements=document.querySelectorAll("#like-button > ytd-like-button-renderer")
|
||||
for(let element of elements) {
|
||||
//Youtube Shorts can have multiple like/dislike buttons when scrolling through videos
|
||||
//However, only one of them should be visible (no matter how you zoom)
|
||||
if(isInViewport(element)) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
}
|
||||
//--- If Watching On Mobile: ---//
|
||||
if (isMobile()) {
|
||||
return document.querySelector(".slim-video-action-bar-actions");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user