Skip to content

Commit 77b2a7f

Browse files
committed
[userscript] youtube-speed-override: fix to only show adjusted duration when playbackRate not 1x
1 parent 9d2aae8 commit 77b2a7f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

userscripts/youtube-speed-override/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// @supportURL https://github.com/0xdevalias/userscripts/issues
1010
// @downloadURL https://github.com/0xdevalias/userscripts/raw/main/userscripts/youtube-speed-override/youtube-speed-override.user.js
1111
// @namespace https://www.devalias.net/
12-
// @version 1.3
12+
// @version 1.3.1
1313
// @match https://www.youtube.com/*
1414
// @grant none
1515
// ==/UserScript==

userscripts/youtube-speed-override/youtube-speed-override.user.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// @supportURL https://github.com/0xdevalias/userscripts/issues
77
// @downloadURL https://github.com/0xdevalias/userscripts/raw/main/userscripts/youtube-speed-override/youtube-speed-override.user.js
88
// @namespace https://www.devalias.net/
9-
// @version 1.3
9+
// @version 1.3.1
1010
// @match https://www.youtube.com/*
1111
// @grant none
1212
// ==/UserScript==
@@ -150,6 +150,8 @@
150150

151151
// Function to update the time display with the adjusted length
152152
function updateAdjustedTimeDisplay() {
153+
if (video.playbackRate === 1) return;
154+
153155
const durationSpan = document.querySelector(videoTimeDisplayDurationSelector);
154156

155157
if (durationSpan) {
@@ -195,9 +197,13 @@
195197
showSpeedChangeNotification();
196198
} else if (e.shiftKey && e.code === 'Space') {
197199
// Don't let the default YouTube handler run
200+
// TODO: these don't seem to actually prevent it currently, as we still seem to pause the video..?
198201
e.preventDefault();
199202
e.stopPropagation();
200203

204+
// TODO: not sure if this will work?
205+
e.stopImmediatePropagation()
206+
201207
video.playbackRate = 1;
202208

203209
// Always show the notification, even when we're at our min value

0 commit comments

Comments
 (0)