Skip to content

Instantly share code, notes, and snippets.

View kevinscud's full-sized avatar

Lusé kevinscud

  • Nairobi, KE
  • 09:21 (UTC +03:00)
View GitHub Profile
@kevinscud
kevinscud / youtube-shorts-autoscroller.js
Created September 2, 2025 20:18
Automatically scrolls through YouTube Shorts by simulating an ArrowDown keypress when each video ends. Paste into your browser console while viewing Shorts to enable hands-free playback.
const scrollEvent = new KeyboardEvent('keydown', {
key: 'ArrowDown',
code: 'ArrowDown',
keyCode: 40,
which: 40,
bubbles: true,
cancelable: true
});
function attachEndedListener(video) {
function EventManager() {
var handlers = {}, queue = {};
function trigger(event) {
var args = [].slice.call(arguments, 1);
if (event in handlers) handlers[event].forEach(function (handler) { handler.apply(null, args); });
}
function on(event, handler) {
if (typeof handler != "function") throw new Error(event + " handler must be a function");