-
Notifications
You must be signed in to change notification settings - Fork 0
/
InstantBar.js
46 lines (41 loc) · 1.33 KB
/
InstantBar.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
43
44
45
46
// ==UserScript==
// @name YouTube Always Hoverable ProgressBar
// @namespace https://github.com/Amadeus-AI
// @version 1.0.2
// @description Makes progressbar hoverable from the very beginning (also works when paused).
// @icon https://www.youtube.com/s/desktop/3748dff5/img/favicon_48.png
// @author AmadeusAI
// @match *://www.youtube.com/*
// @license MIT
// ==/UserScript==
/*jshint esversion: 6 */
var InstantBar =
{
css :
`
.ytp-chrome-bottom { opacity: 0 }
.ytp-gradient-bottom { opacity: 0 }
.html5-video-player:not(.ytp-fullscreen):hover > .ytp-chrome-bottom { opacity: 1 }
.html5-video-player:not(.ytp-fullscreen):hover > .ytp-gradient-bottom { opacity: 1 }
.html5-video-player.ytp-fullscreen > .ytp-chrome-bottom:hover { opacity: 1 }
`,
apply : function()
{
if (typeof GM_addStyle !== "undefined")
{
GM_addStyle(InstantBar.css);
}
else
{
let styleNode = document.createElement("style");
styleNode.appendChild(document.createTextNode(InstantBar.css));
(document.querySelector("head") || document.documentElement).appendChild(styleNode);
}
},
start : function()
{
// To overwrite youtube's default behavior
setTimeout(InstantBar.apply, 0);
}
};
InstantBar.start();