More shortcut stuff

This commit is contained in:
goodtube4u
2025-09-21 17:00:16 +10:00
parent a0db5c0863
commit b32d781531

View File

@@ -3027,16 +3027,7 @@
// Add keyboard shortcuts
function goodTube_iframe_addKeyboardShortcuts() {
let keyDownFired = false;
document.addEventListener('keydown', function (event) {
// Only do this once
if (keyDownFired) {
return;
}
// Indicate the keydown has fired
keyDownFired = true;
// Don't do anything if we're holding control OR alt OR the command key on mac OR the "hide and mute ads" fallback is active
if (event.ctrlKey || event.altKey || event.metaKey || goodTube_fallback) {
return;
@@ -3071,11 +3062,6 @@
window.top.postMessage('goodTube_nextVideo', '*');
}
});
document.addEventListener('keyup', function (event) {
// Indicate the keydown has not fired
keyDownFired = false;
});
}
// Support double speed shortcuts