Created
February 21, 2020 17:57
-
-
Save JKirchartz/e9a5c128f5e902496d406a6bc0b95d90 to your computer and use it in GitHub Desktop.
Unstick the header from youtube & scroll the movie_player into view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Unstick Youtube | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://*.youtube.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var i, elements = document.querySelectorAll('body *'); | |
setTimeout( function() { | |
for (i = 0; i < elements.length; i++) { | |
if (["sticky", "fixed"].includes(getComputedStyle(elements[i]).position)) { | |
console.log("element found:", elements[i]); | |
elements[i].setAttribute("style", "position: static"); | |
} | |
} | |
}, 5000); | |
setTimeout( function(){ | |
document.getElementById("movie_player").scrollIntoView(); | |
}, 5100); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment