mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-28 17:59:25 -05:00
[GH-ISSUE #20879] feat: send initial postMessage when OpenWebUI runs inside an iframe #34850
Reference in New Issue
Block a user
Originally created by @ragaslan on GitHub (Jan 22, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20879
Check Existing Issues
Verify Feature Scope
Problem Description
When OpenWebUI is embedded in a cross-origin iframe, there is currently no reliable way to prefill or trigger an initial prompt without requiring user interaction inside the iframe. This limits automation and makes integration with external applications more complex.
Desired Solution you'd like
I wrote this code in my fork repository.
What does this do?
This adds support for sending an initial chat input to OpenWebUI when it is loaded inside an iframe. The chat message can be optionally initialized via a URL query parameter, allowing a host application to automatically submit a prompt as soon as the iframe is ready.
How does it work?
initMessagequery parameter from the iframe URLpostMessageevent to the current window with the provided prompt payloadHow was this tested?
Notes
This approach keeps the integration stateless and avoids introducing new global configuration or build-time options.
Alternatives Considered
No response
Additional Context
Example usage:
@ragaslan commented on GitHub (Jan 22, 2026):
I’ve implemented this feature and will open a PR shortly.
Happy to adjust the approach based on any feedback.
PR opened: #20880
Happy to iterate based on feedback.