Skip to content

Instantly share code, notes, and snippets.

@nickdbush
Created December 16, 2020 01:55
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 nickdbush/f6f28bb15252ebde4472680066916cdf to your computer and use it in GitHub Desktop.
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.
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