diff --git a/demo-pages/app-content-height-updates/host-page.html b/demo-pages/app-content-height-updates/host-page.html new file mode 100644 index 0000000..0fb874d --- /dev/null +++ b/demo-pages/app-content-height-updates/host-page.html @@ -0,0 +1,102 @@ + + +
+ + +1. HTML Changes - Append target
query param with your website's
+ origin to the public app URL
+ <iframe src="https://cloud.uipath.com/...?el=VB&target=https://mywebsite.com" id="appIframe"></iframe>
+
+ 2. Script to embed on your webpage that can subscribe to App Height changes and resize the iframe.
+
+ window.addEventListener('message', function(event) {
+ if (event.origin !== "https://yourapp.com") return;
+ if (event.data && event.data.type === "resize") {
+ var iframe = document.getElementById("webAppIframe");
+ iframe.style.height = event.data.height + 'px';
+ }
+ });
+ function sendResizeMessage() {
+ var iframe = document.getElementById("webAppIframe");
+ var iframeHeight = iframe.contentWindow.document.body.scrollHeight;
+ parent.postMessage({ type: "resize", height: iframeHeight }, "*");
+ }
+ window.onload = function() {
+ var iframe = document.getElementById("webAppIframe");
+ iframe.onload = sendResizeMessage;
+ };
+
+