From 7dfb2271597cd736fc6daf9c40f264fc368dda6a Mon Sep 17 00:00:00 2001 From: Peter Hozak Date: Fri, 15 Sep 2023 18:11:41 +0200 Subject: [PATCH] fix frame detection in the example --- public/embed-example.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/embed-example.html b/public/embed-example.html index 14379a2d..8345738d 100644 --- a/public/embed-example.html +++ b/public/embed-example.html @@ -27,7 +27,7 @@

Both search and initial questions, opening inline, expanding iframe height, const iframes = [...document.querySelectorAll('iframe')] window.addEventListener('message', function (event) { if (event.data.type === 'aisafety.info__height') { - const iframe = iframes.find((iframe) => iframe.src === event.source.location.href) + const iframe = event.source.frameElement if (iframe) { iframe.style.height = event.data.height + 'px' }