Repository navigation
feat: Add Flag for native developer tools for WebView2 - #23154
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new cross-platform feature flag to toggle platform-native developer tools for WebView2, and wires it through the various platform-specific native WebView implementations with accompanying docs/sample updates.
Changes:
- Introduce
Uno.UI.FeatureConfiguration.WebView2.EnableDevTools(defaulttruein DEBUG,falsein RELEASE) and obsoleteIsInspectableas an alias. - Apply the flag to enable/disable dev tools across Android, iOS/UIKit, Skia Win32/WPF, X11 (Linux), and Skia macOS native WebView implementations.
- Update documentation and add a new SamplesApp page demonstrating the flag.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/iOSmacOS/UnoWKWebView.iOS.cs | Uses the new EnableDevTools flag for WKWebView.Inspectable on Apple UIKit targets (iOS 16.4+). |
| src/Uno.UI/UI/Xaml/Controls/WebView/Native/Android/NativeWebViewWrapper.Android.cs | Toggles Android WebView remote debugging via SetWebContentsDebuggingEnabled. |
| src/Uno.UI/FeatureConfiguration.cs | Adds EnableDevTools and obsoletes IsInspectable as an alias. |
| src/Uno.UI.Runtime.Skia.Wpf/Extensions/WpfNativeWebView.cs | Applies the flag to WebView2 AreDevToolsEnabled (WPF). |
| src/Uno.UI.Runtime.Skia.Win32/UI/Xaml/Controls/WebView/Win32NativeWebView.cs | Replaces DEBUG-only enabling with the new flag (Win32 Skia). |
| src/Uno.UI.Runtime.Skia.MacOS/UnoNativeMac/UnoNativeMac/UNOWebView.m | Adds a native helper to set WKWebView.inspectable (macOS 13.3+). |
| src/Uno.UI.Runtime.Skia.MacOS/UnoNativeMac/UnoNativeMac/UNOWebView.h | Declares the new native helper function. |
| src/Uno.UI.Runtime.Skia.MacOS/UI/Xaml/Controls/WebView/MacOSNativeWebView.cs | Calls the new native helper using the flag. |
| src/Uno.UI.Runtime.Skia.MacOS/Native/NativeUno.cs | Adds P/Invoke for the new native helper. |
| src/SamplesApp/UITests.Shared/UITests.Shared.projitems | Registers the new sample page files. |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/WebView2Tests/WebView2_EnableDevTools.xaml(.cs) | Adds a sample page demonstrating the flag. |
| src/AddIns/Uno.UI.WebView.Skia.X11/X11NativeWebView.cs | Toggles WebKit developer extras using the flag (X11). |
| doc/articles/feature-flags.md | Documents the new flag and points to WebView2 docs section. |
| doc/articles/controls/WebView.md | Adds a dedicated “Enabling native developer tools” section and per-platform instructions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23154/wasm-skia-net9/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23154/wasm-skia-net9/index.html |
|
The build 211776 found UI Test snapshots differences: Details
|
|
|
GitHub Issue: closes https://github.com/unoplatform/uno-private/issues/1833
PR Type:
What is the current behavior? 🤔
What is the new behavior? 🚀
PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.