Skip to content

Commit

Permalink
🪟 Fix fonsp#1789 (fonsp#1806)
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored Jan 4, 2022
1 parent 1cb4c9c commit 2bcc062
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/components/CellOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@ let IframeContainer = ({ body }) => {
/** Grab the <script> tag for the iframe content window resizer
* @type {HTMLScriptElement} */
let original_script_element = document.querySelector("#iframe-resizer-content-window-script")
// Clone it into the iframe document, so we have the exact same script tag there
let iframe_resizer_content_script = iframeDocument.importNode(original_script_element)
// Fix the `src` so it isn't relative to the iframes url, but this documents url
iframe_resizer_content_script.src = new URL(iframe_resizer_content_script.src, original_script_element.baseURI).toString()

// Insert iframe resizer inside the iframe
let iframe_resizer_content_script = iframeDocument.createElement("script")
iframe_resizer_content_script.src = original_script_element.src
iframe_resizer_content_script.crossOrigin = "anonymous"
iframeDocument.head.appendChild(iframe_resizer_content_script)

// Apply iframe resizer from the host side
Expand Down

0 comments on commit 2bcc062

Please sign in to comment.