-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfix_youtube_player_bottom_gradient.user.js
42 lines (39 loc) · 1.74 KB
/
fix_youtube_player_bottom_gradient.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ==UserScript==
// @name Fix Youtube Player Bottom Gradient
// @namespace https://github.com/StaticPH
// @include /^https?://(www\.)?youtube\.com/watch/.*/
// @include /^https?:\/\/(www\.)?youtube\.com\/watch\?v=.*/
// @version 1.0
// @createdAt 2/26/2021
// @author StaticPH
// @description This "fixes" the excessively large bottom gradient area that sometimes appears on the youtube video player when the mouse cursor is within the player frame. Only observed in Vivaldi so far.
// @license MIT
// @updateURL https://raw.githubusercontent.com/StaticPH/Userscripts/master/fix_youtube_player_bottom_gradient.user.js
// @downloadURL https://raw.githubusercontent.com/StaticPH/Userscripts/master/fix_youtube_player_bottom_gradient.user.js
// @homepageURL https://github.com/StaticPH/UserScripts
// @supportURL https://github.com/StaticPH/UserScripts/issues
// @icon https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/YouTube_full-color_icon_%282017%29.svg/1280px-YouTube_full-color_icon_%282017%29.svg.png
// @grant GM.addStyle
// @grant GM_addStyle
// @run-at document-idle
// ==/UserScript==
(function(){
'use strict';
// GM.addStyle(`
// div.ytp-gradient-bottom { display:none; }
// /* div.ytp-gradient-bottom { z-index:0; } */
// `);
setTimeout(function wait(){
const playerBottomGradient = document.getElementById('movie_player').querySelector('.ytp-gradient-bottom');
if (playerBottomGradient){
console.log('Fixing bottom player gradient height');
playerBottomGradient.style.removeProperty('height');
return;
}
else{
console.log('Waiting to fix bottom player gradient height');
setTimeout(wait, 300);
}
return;
});
})();