aminomancer / uc.css.js

A dark indigo CSS theme for Firefox and a large collection of privileged scripts to add new buttons, menus, behaviors and other opinionated features. The theme is similar to other userChrome stylesheets, but it's intended for use with an autoconfig loader like fx-autoconfig, since it uses JavaScript to implement its more functional features.
Other
340 stars 27 forks source link

[FR] Auto-trigger picture-in-picture? #72

Open ericpa06 opened 1 year ago

ericpa06 commented 1 year ago

Hello. I was thinking if would be possible to create some script that would automatically set the video you are watching it to picture-in-picture mode. Like, when you are watching some YouTube video and switch tabs. The script would automatically set that given video to pip mode, as if you had clicked on it and set up to pip mode before switching tabs.

And then, if you went back to that tab which originated such piped video, it would reverse to normal mode? To avoid run of the mill video elements being set to picture-in-picture, it could maybe be limited to video elements that have audio and which are current playing? As well maybe limiting to 1 video at a time (like, if there is already an element set to pip mode, ignore it)?

Apparently there there is some differences between the way Mozilla implemented pip and the way Google implemented it (at least this what I got from reading a discussion /r/firefox). So this feature seems to be possible on Chromium, but is not the case on Firefox.

https://bugzilla.mozilla.org/show_bug.cgi?id=1611831

Someone created a Bugzilla as well as a Connect Mozilla on that feature request, and one the Firefox developer said they are looking into in the future:

https://bugzilla.mozilla.org/show_bug.cgi?id=1647800 https://connect.mozilla.org/t5/ideas/auto-pip-when-tab-is-changed/idi-p/7917

But I not so sure if will come into fruition so soon. Also, I have no idea about how hard/possible would be to implement this, I assume it must be possible, but I have no idea about the amount of work necessary to implement such feature. Anyway and as always, thank you so much your time and sorry to bother you.

aminomancer commented 1 year ago

It's a good idea, if I get any free time I'll play around with it. Thanks for the suggestion :)

NVins commented 7 months ago

I support! Automatic picture-in-picture playback when minimizing the browser and switching to another tab and window Thank you very much.