Greasy Fork is available in English.

Better YouTube

Toggle mini player when scrolling down in YouTube. Video download by using youtubeinmp3.com API. Rebind space key for play/pause (no more accidentally scroll down).

< 腳本Better YouTube的回應

評論:正評 - 腳本一切正常

§
發表於:2017-06-11

I'm going to fork this

The reason why is because I only need the Mini-player functionality.

The other stuff is just unnecessary feature bloat (You can press k to play/pause; there are better tools such as youtube-dl for downloading videos), and if that wasn't enough, the spacebar override is just irritating.

Did you know that it cancels the ability to type a space into a comment (but for some reason, not the search bar)? That'sprettyannoying.

And it's easy to fix, too.

if(ev.target === /* reference to comment box */)
    return false;

Put that at the top of the event handler and it will cancel if you're focused on a comment box.

Also use document.body.addEventListener("keydown", function(ev){...}), not document.body.onkeydown = function(ev){...}. The reason why is because handlers registered via addEventListener can stack and are called in order of registration, while on... will aggressively override any default functionality.

Anyways, you can expect to see a "Simple Mini Player" script coming around some time in the future. In the mean time, I'm uninstalling yours because I can't deal with that spacebar nonsense.

§
發表於:2017-09-07
編輯:2017-09-07

I had originally thought that Better YouTube was a fork of a deprecated and deleted YouTube Mini Player. Now I can see that YTMP evolved into BYT. I think I'll just find my favorite version from the revision history and fork that, rather than tear through and move around 200 lines of moderately messy JavaScript (by my standards).

Update: I've made the fork. It's based on v5.1, before the extra features started to creep in, but after the script had had some time to mature. Here it is: https://greasyfork.org/en/scripts/32992-youtube-mini-player-fork

發表回覆

登入以回復