Skip to content

Instantly share code, notes, and snippets.

@stephanbogner
Created July 9, 2023 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephanbogner/6855812bb66983dc79ef1b869c37c978 to your computer and use it in GitHub Desktop.
Save stephanbogner/6855812bb66983dc79ef1b869c37c978 to your computer and use it in GitHub Desktop.
Bookmarklet code to toggle Youtube playback interface (to take screenshots)
// 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