Created
August 3, 2020 12:50
-
-
Save rubenhorn/c87810abb6ab59fb908e221486213de4 to your computer and use it in GitHub Desktop.
Tampermonkey script to set YouTube playback speed to 2x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 2xYT | |
// @version 0.1 | |
// @description Automatically sets the playback speed to 2x on YouTube.com | |
// @match *://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const playbackSpeedSettingsKey = 'yt-player-playback-rate'; | |
// Check if already 2x | |
if(!(playbackSpeedSettingsKey in sessionStorage) || JSON.parse(sessionStorage[playbackSpeedSettingsKey]).data != 2){ | |
const playbackSpeedSettings = { 'data':'2', 'creation': Date.now() }; | |
sessionStorage[playbackSpeedSettingsKey] = JSON.stringify(playbackSpeedSettings); | |
// Reload to apply changed settings | |
location.reload(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment