Repository navigation
Conversation
Match WinUI's default WebView2 environment language while preserving explicit language and controller settings. Add focused Windows device tests for coexistence and custom language preservation.
sheiksyedm
temporarily deployed
to
copilot-pat-pool
October 21, 2026 08:40 — with
GitHub Actions
Inactive
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 39512Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 39512" |
sheiksyedm
temporarily deployed
to
copilot-pat-pool
October 21, 2026 08:40 — with
GitHub Actions
Inactive
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
sheiksyedm
temporarily deployed
to
copilot-pat-pool
October 21, 2026 08:41 — with
GitHub Actions
Inactive
sheiksyedm
temporarily deployed
to
copilot-pat-pool
October 21, 2026 08:44 — with
GitHub Actions
Inactive
sheiksyedm
temporarily deployed
to
copilot-pat-pool
October 21, 2026 08:46 — with
GitHub Actions
Inactive
sheiksyedm
temporarily deployed
to
copilot-pat-pool
October 21, 2026 08:46 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Windows device-test results remain unverified, and the previous fix was reverted after CI failures.
No open issues 🎉
What changed in this PR
Addresses blank Windows WebViews alongside HybridWebView by aligning their default WebView2 environment languages.
Changes:
- Apply the application language when HybridWebView has no explicit language.
- Preserve custom settings and the existing initialization path.
- Add Windows tests for coexistence and explicit-language preservation.
| File | Description |
|---|---|
| src/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Windows.cs | Aligns the default environment language with WinUI. |
| src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests_Initialization.Windows.cs | Tests preservation of an explicit language. |
| src/Controls/tests/DeviceTests/Elements/HybridWebView/HybridWebViewTests_Coexistence.Windows.cs | Tests both initialization orders and customized settings. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
kubaflo
approved these changes
Oct 21, 2026
kubaflo
pushed a commit
that referenced
this pull request
Oct 25, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details On Windows, a regular WebView renders blank when used alongside a HybridWebView. This regression was originally reported in #34558 and reported again in #39297 after the previous fix, #35092, was reverted by #35814 because of HybridWebView device-test failures in CI. The reported two-window scenario was reproduced in Sandbox using local HTML to avoid network dependencies. In both initialization orders, the first control loaded successfully while the second failed WebView2 initialization with COMException `0x8007139F`. ### Root Cause WinUI initializes its default WebView2 environment with `Language` set to the first entry in `Windows.Globalization.ApplicationLanguages.Languages`. HybridWebView creates an explicit environment without applying the same language default. WebView2 controls sharing a user data folder require compatible browser-process environment options. The different language defaults make these environments incompatible, preventing the second control from initializing. ### Fix Details Apply WinUI's application-language default when the HybridWebView environment language is unspecified. - Preserve explicitly configured environment languages. - Preserve custom user data folders, profiles, and other environment/controller settings. - Retain a single explicit environment/controller initialization path. - Leave regular WebView initialization and non-Windows implementations unchanged. Unlike the reverted fix, this does not switch between default and explicit initialization depending on whether settings are customized. It resolves the underlying language mismatch for both default and customized initialization. #### Validation Added focused Windows device tests covering: - Default coexistence in both initialization orders. - Coexistence with a custom HybridWebView profile. - Coexistence with explicitly supplied environment options whose language is unspecified. - Preservation of an explicitly configured language. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34558 Fixes #39297 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
kubaflo
pushed a commit
that referenced
this pull request
Oct 26, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details On Windows, a regular WebView renders blank when used alongside a HybridWebView. This regression was originally reported in #34558 and reported again in #39297 after the previous fix, #35092, was reverted by #35814 because of HybridWebView device-test failures in CI. The reported two-window scenario was reproduced in Sandbox using local HTML to avoid network dependencies. In both initialization orders, the first control loaded successfully while the second failed WebView2 initialization with COMException `0x8007139F`. ### Root Cause WinUI initializes its default WebView2 environment with `Language` set to the first entry in `Windows.Globalization.ApplicationLanguages.Languages`. HybridWebView creates an explicit environment without applying the same language default. WebView2 controls sharing a user data folder require compatible browser-process environment options. The different language defaults make these environments incompatible, preventing the second control from initializing. ### Fix Details Apply WinUI's application-language default when the HybridWebView environment language is unspecified. - Preserve explicitly configured environment languages. - Preserve custom user data folders, profiles, and other environment/controller settings. - Retain a single explicit environment/controller initialization path. - Leave regular WebView initialization and non-Windows implementations unchanged. Unlike the reverted fix, this does not switch between default and explicit initialization depending on whether settings are customized. It resolves the underlying language mismatch for both default and customized initialization. #### Validation Added focused Windows device tests covering: - Default coexistence in both initialization orders. - Coexistence with a custom HybridWebView profile. - Coexistence with explicitly supplied environment options whose language is unspecified. - Preservation of an explicitly configured language. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34558 Fixes #39297 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 28, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> ### Issue Details On Windows, a regular WebView renders blank when used alongside a HybridWebView. This regression was originally reported in #34558 and reported again in #39297 after the previous fix, #35092, was reverted by #35814 because of HybridWebView device-test failures in CI. The reported two-window scenario was reproduced in Sandbox using local HTML to avoid network dependencies. In both initialization orders, the first control loaded successfully while the second failed WebView2 initialization with COMException `0x8007139F`. ### Root Cause WinUI initializes its default WebView2 environment with `Language` set to the first entry in `Windows.Globalization.ApplicationLanguages.Languages`. HybridWebView creates an explicit environment without applying the same language default. WebView2 controls sharing a user data folder require compatible browser-process environment options. The different language defaults make these environments incompatible, preventing the second control from initializing. ### Fix Details Apply WinUI's application-language default when the HybridWebView environment language is unspecified. - Preserve explicitly configured environment languages. - Preserve custom user data folders, profiles, and other environment/controller settings. - Retain a single explicit environment/controller initialization path. - Leave regular WebView initialization and non-Windows implementations unchanged. Unlike the reverted fix, this does not switch between default and explicit initialization depending on whether settings are customized. It resolves the underlying language mismatch for both default and customized initialization. #### Validation Added focused Windows device tests covering: - Default coexistence in both initialization orders. - Coexistence with a custom HybridWebView profile. - Coexistence with explicitly supplied environment options whose language is unspecified. - Preservation of an explicitly configured language. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #34558 Fixes #39297 <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details
On Windows, a regular WebView renders blank when used alongside a HybridWebView. This regression was originally reported in #34558 and reported again in #39297 after the previous fix, #35092, was reverted by #35814 because of HybridWebView device-test failures in CI.
The reported two-window scenario was reproduced in Sandbox using local HTML to avoid network dependencies. In both initialization orders, the first control loaded successfully while the second failed WebView2 initialization with COMException
0x8007139F.Root Cause
WinUI initializes its default WebView2 environment with
Languageset to the first entry inWindows.Globalization.ApplicationLanguages.Languages. HybridWebView creates an explicit environment without applying the same language default.WebView2 controls sharing a user data folder require compatible browser-process environment options. The different language defaults make these environments incompatible, preventing the second control from initializing.
Fix Details
Apply WinUI's application-language default when the HybridWebView environment language is unspecified.
Unlike the reverted fix, this does not switch between default and explicit initialization depending on whether settings are customized. It resolves the underlying language mismatch for both default and customized initialization.
Validation
Added focused Windows device tests covering:
Issues Fixed
Fixes #34558
Fixes #39297