Skip to content

fix(settings): resize the settings iframe to its reported height#5891

Merged
elzody merged 1 commit into
mainfrom
fix/settings-iframe-height
Jul 23, 2026
Merged

fix(settings): resize the settings iframe to its reported height#5891
elzody merged 1 commit into
mainfrom
fix/settings-iframe-height

Conversation

@timar

@timar timar commented Jul 21, 2026

Copy link
Copy Markdown
Member
  • Resolves: #
  • Target version: main

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

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

@timar
timar requested review from elzody and juliusknorr as code owners July 21, 2026 10:35
@timar
timar requested review from Copilot and removed request for elzody and juliusknorr July 21, 2026 10:36
@timar
timar requested review from elzody and juliusknorr July 21, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.data as JSON when it arrives as a string, then handle Iframe_Height messages.
  • Verify postMessage sender origin against the iframe URL’s origin before acting on messages.
  • Set iframe height via style.height and add a CSS min-height fallback before the first resize message arrives.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/CoolFrame.vue Outdated
Comment thread src/components/CoolFrame.vue Outdated
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.

@elzody

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
elzody force-pushed the fix/settings-iframe-height branch from c650ab2 to 4d41795 Compare July 23, 2026 21:55
@elzody

elzody commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable34 please

@elzody

elzody commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable33 please

@elzody

elzody commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable32 please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants