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.7k
[webview_flutter]Allow specifying a navigation delegate(Android and Dart). #1236
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
729bcbd
[WebView] Allow specifying a navigation delegate.
amirh 8ac15be
review comments follow-up
amirh 8e2a9e9
remove stray thanks
amirh 46d8bf6
retain HTTP headers when possible when using a navigation delegate
amirh 8d9101c
add more documentation for caveats on Android
amirh a743f8d
format
amirh 6df13d9
use WebViewClientCompat, rename isMainFrame to isForMainFrame
amirh d9d671e
typo fix, update documentation
amirh e3eec87
bump version, update changelog
amirh 530d024
don't call super.shouldOverrideUrlLoading
amirh 151b47d
Merge branch 'master' into navigation_delegate
amirh ad30926
fix nit
amirh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
review comments follow-up
- Loading branch information
commit 8ac15be612a09c774c60efc2ca1130e67007c5a6
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...flutter/android/src/main/java/io/flutter/plugins/webviewflutter/FlutterWebViewClient.java
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ void main() => runApp(MaterialApp(home: WebViewExample())); | |
|
|
||
| const String kNavigationExamplePage = ''' | ||
| <!DOCTYPE html><html> | ||
| <head><title>Navigation Delegate Example</title></head>thanks | ||
|
||
| <body> | ||
mklim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <p> | ||
| The navigation delegate is set to block navigation to the youtube website. | ||
|
|
@@ -53,7 +54,7 @@ class WebViewExample extends StatelessWidget { | |
| _toasterJavascriptChannel(context), | ||
| ].toSet(), | ||
| navigationDelegate: (NavigationRequest request) { | ||
| if (request.url == 'https://www.youtube.com/') { | ||
| if (request.url.startsWith('https://www.youtube.com/')) { | ||
| print('blocking navigation to $request}'); | ||
| return NavigationDecision.prevent; | ||
| } | ||
|
|
||
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
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.
Uh oh!
There was an error while loading. Please reload this page.