Skip to content

Instantly share code, notes, and snippets.

@FunctionDJ
Last active October 5, 2021 15:01
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