Skip to content

Instantly share code, notes, and snippets.

@FunctionDJ
Last active October 5, 2021 15:01
Show Gist options
  • Save FunctionDJ/0add38f1830902f70824c9d1055f4ed5 to your computer and use it in GitHub Desktop.
Save FunctionDJ/0add38f1830902f70824c9d1055f4ed5 to your computer and use it in GitHub Desktop.
YouTube 3/2 Aspect Ratio Toggler (No dependencies)
(() => {
let existing = document.querySelector("#ar")
if (existing) {
existing.remove()
} else {
let styleNode = document.createElement("style")
styleNode.id = "ar"
styleNode.type = "text/css"
styleNode.appendChild(document.createTextNode("video{transform:scaleX(calc((3/2) / (16/9)))}"))
document.head.appendChild(styleNode)
}
})()
{
module: false,
format: {
wrap_iife: true,
preamble: "javascript:"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment