1
// ==UserScript==
// @name YouTube Default Playback Speed
// @namespace tim.local
// @version 1.2
// @description Force a default playback speed via the YouTube player API
// @match https://www.youtube.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
(function () {
'use strict';
const TARGET_RATE = 1.0; // long-term: 1.0
function getPlayer() {
const p = document.getElementById('movie_player');
if (p && typeof p.setPlaybackRate === 'function' && typeof p.getPlaybackRate === 'function') {
return p;
}
return null;
}
function enforce() {
const start = Date.now();
const iv = setInterval(() => {
const p = getPlayer();
if (p && p.getPlaybackRate() !== TARGET_RATE) {
p.setPlaybackRate(TARGET_RATE);
}
if (Date.now() - start > 6000) clearInterval(iv);
}, 250);
}
enforce();
document.addEventListener('yt-navigate-finish', enforce);
})();For immediate assistance, please email our customer support: [email protected]