From 1d976569e6080200477fe11009716d3f87e96ac7 Mon Sep 17 00:00:00 2001 From: Andrey Kozlov <zeus@Andreys-MacBook-Pro.local> Date: Tue, 7 Jun 2022 15:57:23 +0100 Subject: [PATCH] fixes --- src/iframeResizer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/iframeResizer.js b/src/iframeResizer.js index 50041952..146b16fe 100644 --- a/src/iframeResizer.js +++ b/src/iframeResizer.js @@ -6,8 +6,9 @@ addEventListener('message', function(e) { const iframe = document.createElement('iframe'); document.body.appendChild(iframe); window.landscapeappModalIframe = iframe; - const search = e.data.location.search || '?a=a'; - const src = e.data.location.pathname.replace('/pages/', '/pages-modal/') + search + '&selected=' + e.data.selected; + const url = new URL(document.querySelector('#landscape').src); + const search = url.search || '?a=a'; + const src = url.pathname.replace('/pages/', '/pages-modal/') + search + '&selected=' + e.data.selected; iframe.src = src; iframe.style.position = 'fixed'; iframe.style.left = 0;