-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathyoutube.user.js
More file actions
31 lines (23 loc) · 800 Bytes
/
youtube.user.js
File metadata and controls
31 lines (23 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// ==UserScript==
// @name YouTube 1.5x
// @version 3
// @description Play YouTube videos at 1.5x by default.
// @match https://www.youtube.com/watch?*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
//var setSpeedCallbackID;
//function setSpeed() {
// document.dispatchEvent(new KeyboardEvent('keydown', {'key': ">"}));
// document.dispatchEvent(new KeyboardEvent('keydown', {'key': ">"}));
//}
// setSpeedCallbackID = setInterval(setSpeed, 2500);
var setSpeedInterval;
function setSpeed() {
var video = document.querySelector("video");
if (video) {
video.playbackRate = 1.5;
clearInterval(setSpeedInterval);
}
}
setSpeedInterval = setInterval(setSpeed, 1000);