Created
December 16, 2020 01:55
-
-
Save nickdbush/f6f28bb15252ebde4472680066916cdf to your computer and use it in GitHub Desktop.
Often videos on the Learn page at the University of Edinburgh are teeny-tiny for a reason which escapes most of us. Create a bookmark with the location set to the contents of bookmarklet.js and if you click it on a Learn page, it will maximise the space given to the videos. Alternatively, open up DevTools and paste it into the command line.
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
javascript: function resize() { | |
document.querySelectorAll(".kalturawrapper").forEach((wrapper) => { | |
wrapper.parentElement.style.width = "100%"; | |
wrapper.parentElement.style.height = "unset"; | |
wrapper.parentElement.style.maxWidth = "1000px"; | |
wrapper.parentElement.style.maxHeight = "unset"; | |
wrapper.style.width = "100%"; | |
wrapper.style.height = "unset"; | |
wrapper.style.maxWidth = "unset"; | |
wrapper.style.maxHeight = "unset"; | |
wrapper.style.paddingTop = "calc(1080 / 1920 * 100% + 25px)"; | |
}); | |
document.querySelectorAll(".kalturawrapper > iframe").forEach((element) => { | |
element.style.position = "absolute"; | |
element.style.top = "0"; | |
element.style.bottom = "0"; | |
element.style.left = "0"; | |
element.style.right = "0"; | |
}); | |
} | |
resize(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment