fix(settings): resize the settings iframe to its reported height#5891
Merged
Conversation
timar
requested review from
Copilot
and removed request for
elzody and
juliusknorr
July 21, 2026 10:36
There was a problem hiding this comment.
Pull request overview
Fixes iframe auto-resizing for the embedded settings page by correctly parsing postMessage payloads and applying the reported height to the iframe element, improving UX by avoiding inner scrollbars.
Changes:
- Parse
event.dataas JSON when it arrives as a string, then handleIframe_Heightmessages. - Verify
postMessagesender origin against the iframe URL’s origin before acting on messages. - Set iframe height via
style.heightand add a CSSmin-heightfallback before the first resize message arrives.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
elzody
approved these changes
Jul 22, 2026
Comment on lines
+96
to
+99
| // Only trust messages from the Collabora origin that serves the iframe. | ||
| if (event.origin !== new URL(this.iframeUrl).origin) { | ||
| return | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
The embedded settings page posts an Iframe_Height message so the parent can grow the iframe to fit its content. The handler read event.data as an object, but the message arrives as a JSON string, so data.MessageId was always undefined and the resize never ran, leaving a short frame with an inner scrollbar. Parse the string before inspecting it. Also set style.height instead of the deprecated height attribute, which ignores a "<n>px" value, verify the sender origin, and add a min-height fallback for the moment before the first height message arrives. Signed-off-by: Andras Timar <andras.timar@collabora.com>
elzody
force-pushed
the
fix/settings-iframe-height
branch
from
July 23, 2026 21:55
c650ab2 to
4d41795
Compare
Collaborator
|
/backport to stable34 please |
Collaborator
|
/backport to stable33 please |
Collaborator
|
/backport to stable32 please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The embedded settings page posts an Iframe_Height message so the parent can grow the iframe to fit its content. The handler read event.data as an object, but the message arrives as a JSON string, so data.MessageId was always undefined and the resize never ran, leaving a short frame with an inner scrollbar. Parse the string before inspecting it.
Also set style.height instead of the deprecated height attribute, which ignores a "px" value, verify the sender origin, and add a min-height fallback for the moment before the first height message arrives.
Checklist