Skip to content

fix(webview): render inline HTML on web instead of permanent Loading state#2293

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-remediation-a983
Draft

fix(webview): render inline HTML on web instead of permanent Loading state#2293
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-remediation-a983

Conversation

@cursor

@cursor cursor Bot commented Jun 19, 2026

Copy link
Copy Markdown

Bug and impact

Trigger: A screen uses EnsembleWebView with the new html property (merged in PR #2291) on web.

Impact: The widget shows Loading... forever and never renders the HTML. Native/mobile works because only native/webviewstate.dart was updated; the web iframe path still required url and treated url == null as unloaded.

Root cause

PR #2291 added html, htmlBaseUrl, and injectedJavaScript to the controller and native InAppWebView (initialData), but the web implementation (web/webviewstate.dart) was not updated. Setting html clears url, so buildWidget always hit the Loading... branch.

Fix

  • Load inline HTML on web via iframe srcdoc, using shared helpers for base URL + optional injected script (matching native defaults).
  • Update iframe content when html / htmlBaseUrl / injectedJavaScript change.
  • Use the resolved base URL for postMessage origin checks when in HTML mode.
  • Add unit tests for the shared document/origin helpers.

Validation

  • Added modules/ensemble/test/webview_html_content_test.dart.
  • Run from modules/ensemble: flutter test test/webview_html_content_test.dart
  • Flutter SDK was not available in the automation environment; please verify in CI.

Duplicate check

Open in Web View Automation 

…state

PR #2291 added html/htmlBaseUrl/injectedJavaScript support to the native
InAppWebView path but left the web iframe implementation unchanged. On
web, setting html clears url, so buildWidget always showed Loading...

Load inline HTML via iframe srcdoc with the same base URL and injected
script behavior as native initialData, and add unit tests for the shared
document/origin helpers.

Co-authored-by: Sharjeel Yunus <sharjeelyunus@users.noreply.github.com>
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.

1 participant