Created
July 9, 2023 18:24
-
-
Save stephanbogner/6855812bb66983dc79ef1b869c37c978 to your computer and use it in GitHub Desktop.
Bookmarklet code to toggle Youtube playback interface (to take screenshots)
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
// How to create bookmarklet: https://www.freecodecamp.org/news/what-are-bookmarklets/ | |
javascript: (() => { | |
const gradient = ".ytp-gradient-bottom"; | |
const ui = ".ytp-chrome-bottom"; | |
if(document.querySelector(ui).style.opacity === "0"){ | |
document.querySelector(gradient).style.opacity = 1; | |
document.querySelector(ui).style.opacity = 1; | |
}else{ | |
document.querySelector(gradient).style.opacity = 0; | |
document.querySelector(ui).style.opacity = 0; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment