-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter] Add a getTitle method to WebViewController #1979
Conversation
mklim
left a comment
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
|
Could this possibly be a |
Actually no need, there's a page listener that's called when a (or any further) page is loaded, so developers could use that. :-) Ignore my original comment. |
Good point, thanks! I think a broadcast stream makes sense for this case, though I think we would still need this getter for the "current" value (as broadcast streams drop values if there are no listeners). WDYT? |
Your comment is still valid as the title might change without a new page being loaded (e.g javascript code can change the title). I do think it still makes sense to to have this getter as I commented above though. |
|
If JS code can change the title, we'd need to fiddle with the html to get it, unless From my point of view, the current PR (to get the title) provides enough of a building block to build a stream of titles later when combining this with the page listener and perhaps other methods (even a Thx @amirh. |
Yes such listeners are available on Android and iOS. |
| ## 0.3.11+6 | ||
|
|
||
| * Calling destroy on Android webview when flutter webview is getting disposed. | ||
| >>>>>>> master |
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.
@amirh saw this?
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.
oops
…#1981) Reverts #1979 The change broke Fuchsia, as FuchsiaWebViewController implements WebViewPlatformController so it doesn't get the no-op implementation of getTitle. We could change the FuchsiaWebViewController implementation to extend WebViewPlatformController so we can add new methods without requiring roll coordination. I'm reverting temporarily until we resolve the roll issue.
…#1979) Allows inspecting the title of the currently loaded page.
…flutter#1981) Reverts flutter#1979 The change broke Fuchsia, as FuchsiaWebViewController implements WebViewPlatformController so it doesn't get the no-op implementation of getTitle. We could change the FuchsiaWebViewController implementation to extend WebViewPlatformController so we can add new methods without requiring roll coordination. I'm reverting temporarily until we resolve the roll issue.
Description
Allows inspecting the title of the currently loaded page.
Related Issues
flutter/flutter#37177
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?