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.

< Feedback on Youtube Spacebar Pause/Play Fix

Review: ठीक - स्क्रिप्ट चालते, पण त्यात बग आहेत

§
पोस्ट केले: 2023-11-08
संपादित केले: 2023-11-08

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लेखक
§
पोस्ट केले: 2023-11-10

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...).

उत्तर पोस्ट करा

उत्तर पोस्ट करण्यासाठी साइन इन करा.