Created
September 27, 2025 07:07
-
-
Save jlewin/d2f18a0907531904e9b1b5dea70bdc8e to your computer and use it in GitHub Desktop.
Open embedded youtube videos in Canvas to print to pdf
This file contains hidden or 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
| // These embedded links have full transcripts but print to pdf can't get at the content. Opening into a dedicated non-iframe window | |
| // and clearing the fixed height, removes scrollbars and allowing print to pdf to work as expected | |
| function openAllFrames() { | |
| var iframes = Array.from(document.querySelectorAll('#content-wrapper iframe')); | |
| iframes.forEach(function(f) { | |
| window.open(f.src, "_blank"); | |
| }); | |
| } | |
| // Create clickable action item | |
| var text = document.createElement('h1'); | |
| text.textContent = 'Open All Frames'; | |
| text.addEventListener('click', openAllFrames); | |
| const contentWrapper = document.querySelector('#content-wrapper'); | |
| contentWrapper.insertBefore(text, contentWrapper.firstChild); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment