Greasy Fork is available in English.

Youtube like/dislike video and skip ad keyboard shortcuts

Adds keyboard shortcuts [ and ] for liking and disliking videos, and s for skipping pre-video and banner ads.

< Opiniones de Youtube like/dislike video and skip ad keyboard shortcuts

Puntuación: Pasable; el script funciona, pero tiene carencias importantes

§
Publicado: 15/5/2022

To fix this for current (2022-05-14) youtube, do this:

Change:

videoinfo = document.getElementsByTagName("ytd-video-primary-info-renderer");
if(videoinfo.length == 1) {

To:

videoinfo = document.getElementsByTagName("ytd-menu-renderer");
if(videoinfo.length >= 1) {

§
Publicado: 16/5/2022

Actually that's being a little flaky... this might work better:

videoinfo = document.getElementsByTagName("ytd-watch-metadata");
if(videoinfo.length >= 1) {
buttons = videoinfo[0].getElementsByTagName("ytd-toggle-button-renderer");
like = buttons[0];
dislike = buttons[1];
}

§
Publicado: 3/11/2022

This doesn't work in the latest youtube after last week's update. Any thoughts?

§
Publicado: 3/11/2022

Nevermind, switching to another available script recently updated.

§
Publicado: 4/11/2022

Nevermind, switching to another available script recently updated.

What script did you switch to?

§
Publicado: 4/11/2022

Here's a new version that works (with no skippind key shortcut anymore):

// ==UserScript==
// @name Youtube like/dislike video and skip ad keyboard shortcuts
// @namespace nerevar009
// @include https://www.youtube.com/*
// @description Adds keyboard shortcuts [ and ] for liking and disliking videos
// @version 1.2
// @grant none
// ==/UserScript==

var onvideopage, like, dislike, tag;
onvideopage = true;
if(!/^\/watch/.test(location.pathname)) onvideopage = false;

addEventListener("keypress", function(e) {
if(!onvideopage)
return;

if(e.target.getAttribute("contenteditable") == "true")
return;

tag = e.target.tagName.toLowerCase();
if(tag == "input" || tag == "textarea")
return;

like=document.getElementById("segmented-like-button").children[0].children[0].children[0];
dislike=document.getElementById("segmented-dislike-button").children[0].children[0].children[0];

if(e.code == "BracketLeft" && like)
like.click();
else if(e.code == "BracketRight" && dislike)
dislike.click();
});

Publicar respuesta

Inicia sesión para responder.