Skip to content

[release/10.0.3xx] Enable hot reloading for Blazor inside an iframe - #53297

Closed
github-actions[bot] wants to merge 6 commits into
release/10.0.3xxfrom
backport/pr-51006-to-release/10.0.3xx
Closed

github-actions[bot] wants to merge 6 commits into
release/10.0.3xxfrom
backport/pr-51006-to-release/10.0.3xx

Conversation

@github-actions

@github-actions github-actions Bot commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #51006 to release/10.0.3xx

Customer Issue

Hot Reload on Blazor apps doesn't work inside iframes because BrowserRefreshMiddleware.IsBrowserDocumentRequest() only accepts requests with Sec-Fetch-Dest: document. Requests from iframes use Sec-Fetch-Dest: frame or Sec-Fetch-Dest: iframe, causing the middleware to reject them and skip script injection.

This prevents hot reload from working in scenarios like Blazing Story (Storybook clone for Blazor) and any other tooling that embeds Blazor apps within iframe contexts.

Fixes #51005

Description

Updates IsBrowserDocumentRequest to also accept "frame" and "iframe" values for the Sec-Fetch-Dest header, in addition to the existing "document" value. This allows the browser refresh middleware to inject hot reload scripts into iframe-embedded Blazor applications.

Was this a regression?

  • Yes
  • No

Testing

Updated existing tests to validate that frame/iframe requests now return true from IsBrowserDocumentRequest while other non-document values like "serviceworker" still return false. All tests in the BrowserRefresh test suite pass.

Risk

Low. The change adds two additional string comparisons to the existing Sec-Fetch-Dest validation logic without affecting any other functionality.

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
@github-actions
github-actions Bot requested review from a team and tmat as code owners March 6, 2026 02:03
@MiYanni MiYanni added the backport PR that has been backported to a servicing branch label Mar 9, 2026
Simon Zhao (BEYONDSOFT CONSULTING INC) and others added 2 commits April 3, 2026 09:43
@SimonZhao888

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@SimonZhao888

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@marcpopMSFT

Copy link
Copy Markdown
Member

@lewing what's the plan for this and the matching 1xx PR?

@github-actions

Copy link
Copy Markdown
Contributor Author

Due to lack of recent activity, this PR has been labeled as 'Stale'. It will be closed if no further activity occurs within 7 more days. Any new comment will remove the label.

@github-actions github-actions Bot added the stale label Aug 30, 2026
@github-actions github-actions Bot closed this Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport PR that has been backported to a servicing branch stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants