pull/6822/head
Brian Whitton 5 years ago committed by GitHub
parent d58d23e2f7
commit 7eb7984bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -602,6 +602,7 @@ export function add_resize_listener(node: HTMLElement, fn: () => void) {
let unsubscribe: () => void; let unsubscribe: () => void;
if (crossorigin) { if (crossorigin) {
// eslint-disable-next-line no-useless-escape
iframe.src = "data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>"; iframe.src = "data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>";
unsubscribe = listen(window, 'message', (event: MessageEvent) => { unsubscribe = listen(window, 'message', (event: MessageEvent) => {
if (event.source === iframe.contentWindow) fn(); if (event.source === iframe.contentWindow) fn();

Loading…
Cancel
Save