-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[webview_flutter] Send history events #2379
Conversation
hi @wwwdata could you please rebase (& start the next version number) |
6a640b0
to
02a610e
Compare
Just rebased, increased version number and pushed. Thanks for the fast feedback |
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.
Just a few tiny bits, but besides that looks good.
02a610e
to
25fc5a2
Compare
@ened Thanks a lot for the good review feedback. Implemented the requested changes. |
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 as well
7d98ee3
to
fbbc931
Compare
So far I didn't hear anything official... I would be happy to rebase and fix all conflicts here again if somebody then also does a review... |
Send URL change events when the user navigates in the Browser. This also works for JavaScript Navigation that does not actually make any request.
fbbc931
to
505f1a2
Compare
Ok, it's rebased again. We're only in 10 months waiting for a review, so let's give it some time :) |
This would be a great feature to have :) |
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.
Thanks for the contribution! Looks like this fell through the cracks somehow, as it seems to have been approved but then not followed up on.
I've left a few more review comments; if you want to follow up on those and update to the current master, I can make sure this moves forward.
|
||
// TODO(hterkelsen): Remove this when defaultBinaryMessages is in stable. | ||
// https://github.com/flutter/flutter/issues/33446 | ||
// ignore: deprecated_member_use |
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.
Looks like this is obsolete.
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface FLTWKHistoryDelegate : NSObject |
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 class and its methods need declaration comments, per Google style.
self = [super init]; | ||
if (self) { | ||
_methodChannel = channel; | ||
[webView addObserver:self |
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.
Why is this feature based on KVO rather than WKNavigationDelegate
?
@@ -31,6 +31,9 @@ abstract class WebViewPlatformCallbacksHandler { | |||
|
|||
/// Report web resource loading error to the host application. | |||
void onWebResourceError(WebResourceError error); | |||
|
|||
/// Invoked by [WebViewPlatformController] when the URL has changed. | |||
void onUpdateVisitedHistory(String url); |
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.
The naming here seems very Android-centric; is there a reason not to call it something more generic like onUrlChanged
?
|
||
#import "FLTWKHistoryDelegate.h" | ||
|
||
NSString *const keyPath = @"URL"; |
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.
Nit: this should be static
@wwwdata Any chance you have the time to look at this again? It looks like it's so close to landing. |
I am going to close this as stale. Feel free to re-open if you are going to rebase and apply requested changes. |
I am planning to look at adapting this to the current state of the plugins once the iOS conversion to Dart+Pigeon is complete. |
The Dart conversion is complete, but in the meantime we found flutter/flutter#94051 which blocks this, since we currently |
Status update from triage: this is still blocked, but we hope to have it unblocked soon. |
This is unblocked now that v4 has landed. @bparrishMines This is one we should look at updating. |
Closing as this was obsoleted by #7113; the implementation had changed enough that it was easiest to start a new PR rather than update this one. Thanks! |
Description
Send URL change events when the user navigates in the Browser. This also works for JavaScript Navigation that does not actually make any request and therefore would not trigger page load or finish events.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?