Skip to content

Instantly share code, notes, and snippets.

@xpsdeset
Last active January 20, 2024 14:46
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 xpsdeset/feb5dc68f8fa007d8b9c3f735e418dae to your computer and use it in GitHub Desktop.
Save xpsdeset/feb5dc68f8fa007d8b9c3f735e418dae to your computer and use it in GitHub Desktop.
Remove Black Bars from Videos
javascript: (function() {
window.Yscale = {};
const $ = document.querySelector.bind(document);
var r = $(":root");
Yscale.change = (val) => {
val = val.toString().padStart(2, "0");
r.style.setProperty("--sy", `1.${val}`);
};
Yscale.init = () => {
let val = 33;
if (localStorage.vval)
val = parseInt(localStorage.vval);
let video = $("video");
if (location.host.includes("primevideo"))
video = $(".rendererContainer");
let pre = "";
if (location.host.includes("netflix"))
pre = "translate(-50%, -50%)";
video.style.transform = pre + "scaleY(var(--sy))";
video.style.height = `99%`;
Yscale.change(val);
document.addEventListener("keydown", ({
key,
}) => {
if (event.isComposing || event.keyCode === 229) {
return;
}
if (key == "[") {
val += 1;
Yscale.change(val);
}
if (key == "]") {
val -= 1;
Yscale.change(val);
}
localStorage.vval = val;
});
};
Yscale.init();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment