-
Notifications
You must be signed in to change notification settings - Fork 234
HybridWebView (.NET 10): initialization customization and platform view access #3003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HybridWebView (.NET 10): initialization customization and platform view access #3003
Conversation
…on and platform view access; add Windows RunAfterInitialize guidance; custom handler example for WKWebViewConfiguration; update ms.date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive .NET 10 documentation for customizing HybridWebView initialization and accessing platform-specific web views. It provides guidance for developers who need to configure the underlying web view components beyond the standard HybridWebView API.
Key changes:
- Documents platform-specific access patterns for Windows (MauiHybridWebView), Android (WebView), and iOS/Mac Catalyst (WKWebView)
- Provides code examples for post-initialization configuration using HandlerChanged events
- Includes advanced custom handler approach for creation-time configuration requirements
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Learn Build status updates of commit b414286:
|
File | Status | Preview URL | Details |
---|---|---|---|
docs/user-interface/controls/hybridwebview.md | View (>=net-maui-8.0) | Details |
docs/user-interface/controls/hybridwebview.md
- Line 688, Column 44: [Warning: xref-not-found - See documentation]
Cross reference not found: 'Microsoft.Maui.Platform.MauiHybridWebView'.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For the .NET 10 version of this article, we also need to remove the requirement that the hybridwebview.js file needs to be manually created. All you need to reference now in your web content is I'm not sure how to structure the monikers in this doc to do this properly though. |
Learn Build status updates of commit 830c250: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
@jfversluis perhaps something like this would work? A simple app might have the following files and contents:
::: moniker range="<=net-maui-9.0" rest of the index.html goes here.... Then for this section we just exclude it completely for .NET 10+: ::: moniker range="<=net-maui-9.0"
rest of HybridWebView.js .... ::: moniker-end |
Added moniker range for .NET MAUI versioning in HybridWebView documentation.
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Learn Build status updates of commit 189d78f: ✅ Validation status: passed
For more details, please refer to the build report. |
Learn Build status updates of commit c73c4d7: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Learn Build status updates of commit d8c318e: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Learn Build status updates of commit bffe936: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Learn Build status updates of commit 46bb2bc: ✅ Validation status: passed
For more details, please refer to the build report. |
Updated HTML content for HybridWebView with new JavaScript functions for message logging and invoking C# methods. Adjusted script references for different .NET MAUI versions.
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Learn Build status updates of commit 9b31882: ✅ Validation status: passed
For more details, please refer to the build report. |
Learn Build status updates of commit a9b7749: ✅ Validation status: passed
For more details, please refer to the build report. |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Learn Build status updates of commit a9b7749: ✅ Validation status: passed
For more details, please refer to the build report. |
This PR adds .NET 10 guidance to customize initialization and access platform web views in
HybridWebView
.Summary of changes:
docs/user-interface/controls/hybridwebview.md
.MauiHybridWebView.RunAfterInitialize
for safe access toCoreWebView2
after initialization.android.webkit.WebView
) and iOS/Mac Catalyst (WKWebView
) after creation viaHandlerChanged
.WKWebViewConfiguration
at creation time when platform options must be set before the view is created.ms.date
.Motivation / verification:
RunAfterInitialize
.MauiHybridWebView
helper.Related upstream references:
Docs hygiene:
Once merged, I'll update the tracker entry to link to this PR and mark status accordingly.
Internal previews