From f6ca14e5f11a7267ffbe3c49631a8f122395331c Mon Sep 17 00:00:00 2001 From: emielvdveen Date: Fri, 8 Dec 2023 01:20:01 +0100 Subject: [PATCH] Added resize observer --- src/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index acf5e1b9..389cfb1b 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -28,3 +28,11 @@ if (process.env.REACT_APP_BUILD!=='standalone' && process.env.NODE_ENV === 'prod console.log('Running with fake storage') run(new FakeStorage()) } + +const observer = new ResizeObserver(() => { + const height = window.document.body.scrollHeight; + const action = "resize" + window.parent.postMessage({action, height}, "*") +}); + +observer.observe(window.document.body); \ No newline at end of file