This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[webview_flutter_android] Fixes bug where a AndroidNavigationDelegate
was required to load a request
#6872
Merged
Conversation
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
AndroidNavigationDelegate
was required to load a request
stuartmorgan-g
approved these changes
Dec 21, 2022
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.
LGTM with nit
@@ -80,7 +79,7 @@ public void setWebContentsDebuggingEnabled(boolean enabled) { | |||
/** Implementation of {@link WebView} that can be used as a Flutter {@link PlatformView}s. */ | |||
public static class WebViewPlatformView extends WebView implements PlatformView { | |||
private WebViewClient currentWebViewClient; | |||
private WebChromeClientImpl currentWebChromeClient; | |||
private WebChromeClientHostApiImpl.SecureWebChromeClient currentWebChromeClient; |
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.
Couldn't the type here just be WebChromeClient
since it's only being accessed via overridden methods?
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.
This could be set to WebChromeClient
, but then the overridden methods would have to cast this value.
@@ -135,7 +141,7 @@ public void setWebChromeClient(WebChromeClient client) { | |||
public static class InputAwareWebViewPlatformView extends InputAwareWebView | |||
implements PlatformView { | |||
private WebViewClient currentWebViewClient; | |||
private WebChromeClientImpl currentWebChromeClient; | |||
private WebChromeClientHostApiImpl.SecureWebChromeClient currentWebChromeClient; |
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.
Same.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Dec 22, 2022
…ionDelegate` was required to load a request (flutter/plugins#6872)
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Dec 22, 2022
* c61ac23fc [webview_flutter_wkwebview] Adds support for `WKNavigationAction.navigationType` (flutter/plugins#6863) * 15cfe8aa2 [webview_flutter_android] Adds support for selecting Hybrid Composition (flutter/plugins#6864) * 2dd85ec81 [webview_flutter_android] Fixes bug where a `AndroidNavigationDelegate` was required to load a request (flutter/plugins#6872)
loic-sharma
pushed a commit
to fluttergithubbot/flutter
that referenced
this pull request
Jan 6, 2023
…#117535) * c61ac23fc [webview_flutter_wkwebview] Adds support for `WKNavigationAction.navigationType` (flutter/plugins#6863) * 15cfe8aa2 [webview_flutter_android] Adds support for selecting Hybrid Composition (flutter/plugins#6864) * 2dd85ec81 [webview_flutter_android] Fixes bug where a `AndroidNavigationDelegate` was required to load a request (flutter/plugins#6872)
gspencergoog
pushed a commit
to gspencergoog/flutter
that referenced
this pull request
Jan 19, 2023
…#117535) * c61ac23fc [webview_flutter_wkwebview] Adds support for `WKNavigationAction.navigationType` (flutter/plugins#6863) * 15cfe8aa2 [webview_flutter_android] Adds support for selecting Hybrid Composition (flutter/plugins#6864) * 2dd85ec81 [webview_flutter_android] Fixes bug where a `AndroidNavigationDelegate` was required to load a request (flutter/plugins#6872)
mauricioluz
pushed a commit
to mauricioluz/plugins
that referenced
this pull request
Jan 26, 2023
…e` was required to load a request (flutter#6872) * fix bug * comment * another test * fix spelling
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
autosubmit
Merge PR when tree becomes green via auto submit App
p: webview_flutter
Edits files for a webview_flutter plugin
platform-android
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.
The default
WebChromeClient
was being set toWebChromeClientImpl
which would attempt to communicate with Dart in theonProgressChanged
callback (viaWebChromeClientFlutterApi
).This moves the logic that ensures only secure url can attempt to open a window out of
WebChromeClientImpl
and into its own class (SecureWebChromeClient
). The defaultWebView.webChromeClient
is then set toSecureWebChromeClient
which doesn't attempt to communicate with Dart.Fixes flutter/flutter#117333
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.