OpenWebui-Tools icon indicating copy to clipboard operation
OpenWebui-Tools copied to clipboard

iFrames do not know the required height.

Open HandyGold75 opened this issue 6 months ago • 2 comments

In https://github.com/iChristGit/OpenWebui-Tools/issues/3 is was advised to allow iFrame same origin. Although the issue can also be resolved by appending the below code snippet. OpenWebUI recommends this solution over allowing same origin as documented here: https://docs.openwebui.com/features/extensibility/plugin/development/rich-ui/#postmessage-height-reporting-recommended

<script>
  function reportHeight() {
    const h = document.documentElement.scrollHeight;
    parent.postMessage({ type: 'iframe:height', height: h }, '*');
  }
  window.addEventListener('load', reportHeight);
  // Also re-report when content changes size
  new ResizeObserver(reportHeight).observe(document.body);
</script>

Is there a reason this hasn't been done? Otherwise I'm willing to get a PR ready that adds this to most modules.

HandyGold75 avatar May 28 '26 13:05 HandyGold75

Hey. welcome to submit PRs I am not sure all tools can work this way tho.. (jellyfin, comfyui with tailscale) but most tools can

iChristGit avatar May 30 '26 18:05 iChristGit

Merged and will update it to OpenWebui.com as well. Thank you

iChristGit avatar Jun 01 '26 20:06 iChristGit