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.
[Android] Fix custom WebViewClient being overridden by MAUI handler mapper #34426
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
Uh oh!
There was an error while loading. Please reload this page.
[Android] Fix custom WebViewClient being overridden by MAUI handler mapper #34426
Changes from all commits
1ce7ca206df22a4492fe985d588c235b48e3706925File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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.
[moderate] Regression Prevention and Test Coverage — This test stops after the custom client receives one navigation, so it never exercises the DisconnectHandler path changed by this PR. As written it would still pass even if a custom/shared WebViewClient is disposed during page teardown and then fails when reused. Please add a lifecycle assertion (for example navigate away/recreate the page or reuse the same custom client across two handler lifetimes) so the ownership/disposal regression is covered.
Uh oh!
There was an error while loading. Please reload this page.
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.
[major] Android WebViewHandler lifecycle — This disposes whichever WebViewClient/WebChromeClient is currently installed, including clients supplied by an app/custom handler. SetWebViewClient/SetWebChromeClient does not transfer ownership to MAUI; a shared or otherwise externally-owned client will be disposed when one handler disconnects and can then throw ObjectDisposedException when reused. Please only detach the platform view and disconnect/dispose clients owned by this handler, not arbitrary current clients.
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.
[major] Public API Surface — These methods are already shipped public Android APIs (they are still listed in PublicAPI.Shipped.txt), so marking them REMOVED and deleting the methods is a source-breaking change for apps or libraries that call/customize them. The mapper entries can be removed without breaking callers by keeping MapWebViewClient/MapWebChromeClient as compatibility shims, for example idempotent no-ops or default-client initializers.
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.
[major] Public API Surface — MapWebViewClient and MapWebChromeClient are shipped Android APIs (they remain listed in PublicAPI.Shipped.txt), so removing them is a source/binary break for apps that call these helpers from custom WebView mapper code. The lifecycle fix can still move default client creation earlier while keeping these methods as compatibility shims that preserve the old behavior instead of removing the shipped members.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.