Skip to content

Instantly share code, notes, and snippets.

@fent
Last active November 26, 2022 08:49
Show Gist options
  • Save fent/98694ba45c4a547091e7 to your computer and use it in GitHub Desktop.
Save fent/98694ba45c4a547091e7 to your computer and use it in GitHub Desktop.
A bunch of greasemonkey scripts to fullscreen video sites

If you watch a lot of videos, you may find these useful.

Use this one for youtube: https://greasyfork.org/en/scripts/811-resize-yt-to-window-size

If you want to control the youtube and twitch players with keyboard shortcuts, I also have these https://github.com/fent/dotfiles/tree/master/Scripts

To move videos to another "player" window as they are opened, and pause any playing videos, https://github.com/fent/chrome-vsnap

To keep track of your subscriptions https://chrome.google.com/webstore/detail/veefeed/elpfmfdcigaklhenpknoifgfcfnefkdf

// ==UserScript==
// @name dailymotion fullscreen video
// @namespace https://github.com/fent
// @version 0.1.0
// @include /^https?:\/\/www\.dailymotion\.com\/video\//
// ==/UserScript==
const $style = document.createElement('style');
$style.innerHTML =
'html, body {\n' +
' height: 100%;\n' +
'}\n' +
'#player_container {\n' +
' position: relative;\n' +
' width: 100%;\n' +
' height: 100%;\n' +
' z-index: 9999;\n' +
'}\n' +
'#playerv5_box {\n' +
' height: 100% !important;\n' +
'}\n';
document.body.append($style);
const $player = document.getElementById('player_container');
document.body.prepend($player);
// ==UserScript==
// @name twitch auto theatre mode
// @namespace https://github.com/fent
// @version 0.1.8
// @include /https?://(www\.)?twitch\.tv/(videos/\d+|[a-zA-Z_]+)/
// ==/UserScript==
const findButton = (callback) => {
const search = () => document.querySelector('button[data-a-target="player-theatre-mode-button"]');
let maxAttempts = 15;
let iid = setInterval(() => {
const $theatre = search();
if ($theatre || --maxAttempts === 0) {
clearInterval(iid);
}
if ($theatre) {
setTimeout(callback.bind(null, $theatre), 200);
}
}, 1000);
};
findButton(($theatre) => {
$theatre.click();
});
// ==UserScript==
// @name worldstarhiphop fullscreen video
// @namespace https://github.com/fent
// @version 0.1.0
// @include /^https?:\/\/www\.worldstarhiphop\.com\/videos\/video\.php/
// ==/UserScript==
const $style = document.createElement('style');
$style.innerHTML =
'html, body {\n' +
' height: 100%;\n' +
'}\n' +
'.video-player {\n' +
' position: relative;\n' +
' width: 100%;\n' +
' height: 100%;\n' +
' z-index: 9999;\n' +
'}\n' +
'.video-player > div, .video-player embed {\n' +
' width: 100%;\n' +
' height: 100%;\n' +
'}\n';
document.body.append($style);
const $player = document.getElementsByClassName('video-player')[0];
document.body.prepend($player);
// ==UserScript==
// @name worldstaruncut fullscreen video
// @namespace https://github.com/fent
// @version 0.1.0
// @include /^https?:\/\/www\.worldstaruncut\.com\/uncut\//
// ==/UserScript==
const $style = document.createElement('style');
$style.innerHTML =
'html, body {\n' +
' height: 100%;\n' +
'}\n' +
'#NAPPdiv {\n' +
' position: relative;\n' +
' width: 100%;\n' +
' height: 100%;\n' +
' z-index: 9999;\n' +
'}\n' +
'#NAPPdiv embed {\n' +
' width: 100%;\n' +
' height: 100%;\n' +
'}\n';
document.body.append($style);
const $player = document.getElementById('NAPPdiv');
document.body.prepend($player);
@thienha1
Copy link

Can you make scripts that set a timer to automatically pause/stop on all Youtube embed videos? Like pause a video after X seconds!!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment