| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR expands Uno’s WebView2 / CoreWebView2 implementation to better match WebView2 API behavior across platforms (Skia Win32/macOS, iOS, Android, WebAssembly, X11), including explicit initialization, lifecycle events, settings (User-Agent / JS / zoom), cookie management, printing, and postMessage support, plus new SamplesApp manual-test pages.
Changes:
Copilot reviewed 54 out of 70 changed files in this pull request and generated 2 comments.
Show a summary per file| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/WebView/WebView2/WebView2.Properties.cs | Guards Source updates when closed; triggers implicit init on Source changes. |
| src/Uno.UI/UI/Xaml/Controls/WebView/WebView2/WebView2.cs | Adds explicit init overloads, close/dispose behavior, and initialization event/error propagation. |
| src/Uno.UI/UI/Xaml/Controls/WebView/WebView2/CoreWebView2InitializedEventArgs.cs | Adds internal ctor to carry initialization exceptions. |
| src/Uno.UI/UI/Xaml/Controls/WebView/WebView1/WebView.cs | Implements new IWebView.RequiresExplicitInitialization contract for legacy WebView. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/Wasm/NativeWebView.wasm.cs | Adds capability-interface implementations and improved navigation/message lifecycle for WASM iframe host. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/Wasm/NativeWebView.Interop.wasm.cs | Adds JSImport entries for postMessage, print UI, and close. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsZoomControl.cs | New capability interface (zoom enable/disable). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsUserAgent.cs | New capability interface (User-Agent override). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsScriptEnabled.cs | New capability interface (JS enable/disable). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsPrint.cs | New capability interface (print UI / PDF stream). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsPostWebMessage.cs | New capability interface (native host-to-page messaging). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsDocumentCreatedScripts.cs | New capability interface (document-start script injection). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsCookieManager.cs | New capability interface (cookie store operations). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/ISupportsClose.cs | New capability interface (explicit native close). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/iOSmacOS/UnoWKWebView.iOS.cs | Adds iOS/macOS WebKit-backed implementations for settings, cookies, scripts, and printing. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/Android/NativeWebViewWrapper.Android.cs | Adds Android implementations for settings, cookies, scripts, and printing (UI only). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/Android/InternalWebClient.Android.cs | Injects document-created scripts at navigation start on Android. |
| src/Uno.UI/UI/Xaml/Controls/WebView/IWebView.cs | Adds RequiresExplicitInitialization to control native creation timing. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2Settings.cs | Adds UserAgent, IsScriptEnabled, IsZoomControlEnabled with change notifications. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2PrintSettings.cs | Introduces a managed CoreWebView2PrintSettings surface + validation. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2EnvironmentOptions.cs | Introduces managed environment options surface + default-value tracking. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2Environment.cs | Introduces managed environment surface + factory methods. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2DOMContentLoadedEventArgs.cs | Adds managed DOMContentLoaded event args. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2CookieManager.cs | Adds managed cookie manager surface backed by capability interface. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2Cookie.cs | Adds managed cookie model surface. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2ControllerOptions.cs | Adds managed controller options surface. |
| src/Uno.UI/UI/Xaml/Controls/WebView/Core/CoreWebView2ContentLoadingEventArgs.cs | Adds managed ContentLoading event args. |
| src/Uno.UI/ts/Windows/UI/Xaml/Controls/WebView.ts | Updates WASM host glue for JSON-serialized script results, postMessage, printing, and close. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2Settings.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2ServerCertificateErrorDetectedEventArgs.cs | Replaces not-implemented stub with usable managed shape. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2PrintSettings.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2PermissionRequestedEventArgs.cs | Replaces not-implemented stub with usable managed shape. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2FrameCreatedEventArgs.cs | Replaces not-implemented stub with usable managed shape. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2EnvironmentOptions.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2Environment.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2DownloadStartingEventArgs.cs | Replaces not-implemented stub with usable managed shape. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2DOMContentLoadedEventArgs.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2CookieManager.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2Cookie.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2ControllerOptions.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2ContextMenuRequestedEventArgs.cs | Replaces not-implemented stub with usable managed shape. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2ContentLoadingEventArgs.cs | Adjusts generated stubs to defer to newly implemented managed members. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/CoreWebView2.cs | Adjusts generated stubs to defer to newly implemented managed members/events/methods. |
| src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Controls/WebView2.cs | Adjusts generated stubs to defer to newly implemented WebView2 members. |
| src/Uno.UI.Runtime.Skia.Win32/UI/Xaml/Controls/WebView/Win32NativeWebView.cs | Adds Win32 implementations for cookies, printing, UA/JS/zoom, messaging, doc-created scripts, lifecycle events, and env/controller options. |
| src/Uno.UI.Runtime.Skia.MacOS/UnoNativeMac/UnoNativeMac/UNOWebView.h | Extends native macOS bridge API for lifecycle callbacks, printing, cookies, scripts, UA/JS, postMessage, and private mode creation. |
| src/Uno.UI.Runtime.Skia.MacOS/UI/Xaml/Controls/WebView/MacOSNativeWebViewProvider.cs | Registers lifecycle + capability callbacks for macOS native webview. |
| src/Uno.UI.Runtime.Skia.MacOS/UI/Xaml/Controls/WebView/MacOSNativeWebView.cs | Adds close/unregister logic, private mode creation option, and lifecycle callback wiring. |
| src/Uno.UI.Runtime.Skia.MacOS/UI/Xaml/Controls/WebView/MacOSNativeWebView.Capabilities.cs | Implements macOS capabilities for UA/JS/zoom, messaging, scripts, cookies, and printing using native bridge callbacks. |
| src/Uno.UI.Runtime.Skia.MacOS/Native/NativeUno.cs | Adds P/Invoke signatures for new native macOS webview bridge APIs. |
| src/SamplesApp/UITests.Shared/UITests.Shared.projitems | Registers new manual SamplesApp WebView2 test pages. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_UserAgent.xaml.cs | Adds manual sample for CoreWebView2Settings.UserAgent. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_UserAgent.xaml | XAML for User-Agent sample page. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_Print.xaml.cs | Adds manual sample for PDF printing + print UI. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_Print.xaml | XAML for printing sample page. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_PostWebMessage.xaml.cs | Adds manual sample for host-to-page messaging. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_PostWebMessage.xaml | XAML for messaging sample page. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_LifecycleEvents.xaml.cs | Adds manual sample for lifecycle event ordering/logging. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_LifecycleEvents.xaml | XAML for lifecycle sample page. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_EnvironmentOptions.xaml.cs | Adds manual sample for env/controller options initialization. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_EnvironmentOptions.xaml | XAML for env/controller options sample page. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_DocumentCreatedScripts.xaml.cs | Adds manual sample for document-created scripts. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_DocumentCreatedScripts.xaml | XAML for document-created scripts sample page. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_CookieManager.xaml.cs | Adds manual sample for cookie manager operations. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_CookieManager.xaml | XAML for cookie manager sample page. |
| src/AddIns/Uno.UI.WebView.Skia.X11/X11NativeWebView.cs | Adds capability implementations for X11 WebKitGTK provider (UA/JS/zoom/scripts/print; cookies remain unsupported). |
| src/.gitignore | Ignores macOS runtime native output folder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
…and various settings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7de737fe-af1e-42b9-ab99-19c5b03d8d96
|
Claude finished @morning4coffe-dev's task in 5m 42s —— View job PR Review: feat(webview2): Improve API parity across platformsTasks:
SummaryVerdict: fix-first — the PR is a solid, well-structured feature with good coverage across platforms and tests. A few issues should be addressed before it can land cleanly. Issues by severity
Cross-cutting notesNull URI in GetCookiesAsync — CoreWebView2CookieManager.GetCookiesAsync accepts null via string.IsNullOrEmpty, then forwards it directly to all native implementations. The Android JNI path (CookieManager.GetCookie(null)) is the primary crash risk; iOS silently catches it but masks the bad call. Fix at the manager layer (uri ?? string.Empty) and narrow the iOS catch {} to UriFormatException only. ShowPrintUI async fire-and-forget — platform failures (GTK, native bridge) are silently swallowed. Add a logging continuation so failures surface in diagnostics. Capability-interface design — the ISupports* interface decomposition is clean and follows the existing ISupportsWebResourceRequested pattern well. ISupportsCookieManager is correctly declared internal and the NotSupportedException message strings on WASM/X11 are clear and actionable. Test coverage — runtime tests are well-scoped to macOS and WASM, cover the intended scenarios (lifecycle ordering, cookie round-trip, init idempotency, environment rejection), and use [PlatformCondition] correctly rather than #if. No [Ignore]d or Assert.Inconclusive tests found. PR draft state — the description calls this out explicitly (rebase needed, platform-wide validation pending). The inline comments above apply to the code as-is; the overall shape of the implementation is sound. |
Sorry, something went wrong.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23754/wasm-skia-net9/index.html |
Sorry, something went wrong.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23754/wasm-skia-net9/index.html |
Sorry, something went wrong.
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-23754/docs/index.html |
Sorry, something went wrong.
|
Claude encountered an error after 25s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
/azp run Uno.UI - CI |
Sorry, something went wrong.
|
Azure Pipelines successfully started running 1 pipeline(s). |
Sorry, something went wrong.
|
Claude encountered an error after 16s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23754/wasm-skia-net9/index.html |
Sorry, something went wrong.
|
The build 229955 found UI Test snapshots differences: skia-linux-screenshots: 57, skia-windows-screenshots: 2346, wasm: 11 Details
|
Sorry, something went wrong.
|
Claude encountered an error after 14s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
CI status: Uno.UI - CI build 229955 is green (20 stages succeeded, 7 skipped, 0 failed), as are all other checks. All review threads are resolved. The only red check is the review (Claude Code Review) GitHub Action, which is failing for reasons outside this PR's contents:
The earlier red run on 229926 was infrastructure too, and both jobs pass on the re-run: Tests - Android Skia Runtime Tests 0 hit the 45-minute agent cap because the app process never appeared in adb shell ps after am start (the same APK started fine in groups 1-4 of that build), and Tests - Desktop Skia macOS Runtime Tests hit the 60-minute agent cap while still running unrelated Slider tests. |
Sorry, something went wrong.
|
Claude encountered an error after 26s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 18s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 23s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 20s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Follow-up on the red review check — it is now conclusively deterministic, not transient. Nine reruns of run 32796980761 between 01:17Z and 10:59Z all failed with a byte-identical signature: "is_error": true, "num_turns": 2, total_cost_usd between 0.9819 and 1.0009, 14–26s, no assistant output, No buffered inline comments. A capacity or rate-limit problem would vary in turn count and cost; a cost that lands within 2% of $1.00 on all nine attempts is an input-size ceiling being hit on the very first tool result. That is consistent with the workflow configuration and this PR's size: .github/workflows/claude-code-review.yml runs --model claude-sonnet-4-6 (200K context) with track_progress: true and Bash(gh pr diff:*) allowed. Here gh pr diff returns ~363 KB and the PR comment history is ~138 KB, so the second turn exceeds the context window. The same workflow fails identically today on the other large PRs (dev/doti/appium-a11y-validation, dev/doti/port-richeditbox, dev/doti/app-notifications) and succeeds on smaller ones (dev/mazi/dead-conditional-branches, dev/doti/port-semanticzoom), so the action and the service are healthy. Everything else on this PR is green: Uno.UI - CI 229955 succeeded (20 stages, 0 failed), 71 checks pass, 0 unresolved review threads, and the screenshot-comparison set is byte-for-byte the same as the pre-change run on 68146e81. I am not going to touch the workflow or the reviewed code to work around this, since both would change what is being validated. Resolving it needs a maintainer decision — for example raising the review model's context for large PRs, or acknowledging this check as not applicable here. I will keep retrying the workflow on a backoff in case it starts passing on its own. |
Sorry, something went wrong.
|
Claude encountered an error after 16s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 17s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 17s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 8s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 23s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 16s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 15s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 11s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
One more finding that changes what can unblock the red review check. The failing job is not using the v1.0.175 pin that is on this branch. Because claude-code-review.yml runs on pull_request, the workflow is resolved from the PR merge ref, so it picks up master's pin. The job logs show the action resolving to _actions/anthropics/claude-code-action/459ad358ae43fea66bfefd0a1f8d840b4b9791fb, which is v1.0.194 — the version #24140 merged into master on 2026-08-22. So the newer action is already in play and still fails. That matters for #24217 (bump to v1.0.202): gh run rerun replays run 32796980761 against the same commit and the same workflow snapshot, so no amount of rerunning will pick up a newer action. Only a fresh workflow run would, and this workflow only triggers on opened, synchronize, ready_for_review, and reopened. Current tally: 17 reruns between 2026-08-25T01:17Z and 2026-08-27T01:52Z, every one "is_error": true / "num_turns": 2 / total_cost_usd in [0.9819, 1.0009], no assistant output, No buffered inline comments. I am deliberately not forcing a fresh run: the only ways to do so are a push, a draft/ready toggle, or a close/reopen, and all three would discard the currently green result set (Uno.UI - CI 229955, 20 stages, 0 failed) and re-queue a full ~1h pipeline for a check that is not a merge gate. Merging master would also not shrink gh pr diff, which is the input that overflows the context. So the options that actually resolve this all belong to a maintainer: land #24217 and let the next legitimate push produce a fresh run, raise the review model's context for large PRs, or record that this check does not apply to a PR of this size. The PR itself is otherwise complete — 71 checks pass and there are no unresolved review threads. |
Sorry, something went wrong.
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
GitHub Issue: closes #12644, closes #17711, closes #22415
PR Type:
✨ Feature
What changed? 🚀
Current platform support
Unsupported platform requests fail explicitly instead of being silently ignored.
Validation
The Windows runtime tests now include the default AOT backend and will run in CI; local Windows runtime execution was not available from the macOS validation host.
PR Checklist ✅