Skip to content

fix: block F5/Refresh in chat webview to prevent blank screen#558

Open
laileni-aws wants to merge 4 commits into
aws:mainfrom
laileni-aws:fix/block-f5-refresh-blank-screen
Open

fix: block F5/Refresh in chat webview to prevent blank screen#558
laileni-aws wants to merge 4 commits into
aws:mainfrom
laileni-aws:fix/block-f5-refresh-blank-screen

Conversation

@laileni-aws

@laileni-aws laileni-aws commented May 29, 2026

Copy link
Copy Markdown
Contributor

Problem

When the Amazon Q Chat view has focus and the user presses F5 (or triggers a browser refresh via Cmd+R / context menu), the entire chat UI disappears and is replaced by a blank white screen. The chat does not recover without manually closing and reopening the view.

Prevents the chat webview from going blank when the user accidentally triggers a browser refresh (F5, Cmd+R, or context menu reload).

The chat webview uses browser.setText(html) to render content inline with no backing URL. A refresh causes the browser to navigate to about:blank, wiping the UI entirely.

Fix:

  • Added a LocationListener that blocks any navigation to about:blank, preventing the blank screen regardless of how the refresh is triggered.
  • Added a KeyListener that intercepts F5 keypress and suppresses it as an additional safeguard.

Testing:

  1. Open the Amazon Q Chat view and confirm it loads normally
  2. Press F5 with the chat view focused → chat UI remains intact
  3. Try Cmd+R (macOS) or right-click → Reload if available → chat UI remains intact
  4. Confirm normal chat functionality (send/receive messages) is unaffected

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@laileni-aws laileni-aws marked this pull request as ready for review May 29, 2026 17:07
@laileni-aws laileni-aws force-pushed the fix/block-f5-refresh-blank-screen branch 2 times, most recently from 3dc6542 to fee958e Compare May 29, 2026 23:23
@laileni-aws laileni-aws force-pushed the fix/block-f5-refresh-blank-screen branch from fee958e to 122444c Compare May 29, 2026 23:25
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