Greasy Fork is available in English.

Youtube Spacebar Pause/Play Fix

A Youtube bug disables the space key shortcut, which often happens when you change windows and return to Youtube, often with the ALT + TAB shortcut. This script ensures that the spacebar PAUSE / PLAY shortcut works correctly.

< Відгуки до Youtube Spacebar Pause/Play Fix

Відгук: OK - script works, but has bugs

§
Опубліковано: 08.11.2023
Edited: 08.11.2023

It won't work until you go to url http://youtube.com/watch... directly, not from https://youtube.com. It's because youtube has it's own refresh system, so tampermonkey can't take that you're opened a video. Simple fix: just replace

// @match https://www.youtube.com/watch*
// @match http://www.youtube.com/watch*
// @match https://youtube.com/watch*
// @match http://youtube.com/watch*

with

// @include https://www.youtube.com*
// @include http://www.youtube.com*
// @include https://youtube.com*
// @include http://youtube.com*

Freschko YamatoАвтор
§
Опубліковано: 10.11.2023

It won't work until you go to url http://youtube.com/watch... directly, not from https://youtube.com. It's because youtube has it's own refresh system, so tampermonkey can't take that you're opened a video. Simple fix: just replace

// @match https://www.youtube.com/watch*
// @match http://www.youtube.com/watch*
// @match https://youtube.com/watch*
// @match http://youtube.com/watch*

with

// @include https://www.youtube.com*
// @include http://www.youtube.com*
// @include https://youtube.com*
// @include http://youtube.com*

Thank you for your very constructive comment ! It's true I hadn't taken into account the fact that youtube uses this single page system.

I fixed that in my last update and normally it should work just fine event we go from https://youtube.com or any other youtube page, I invite you to download the last version since I also had to change a few things (like updating the listeners on the video each time you open a new video page etc...).

Опублікувати відповідь

Sign in to post a reply.