-
Notifications
You must be signed in to change notification settings - Fork 939
Open
Labels
Description
Use case
I'd like to show the title of the current page in the AppBar. The title should be shown as soon as it's available, not only when the page has finished loading.
I know about the usual workaround to use evalJavascript('document.title')
that is recommended in other issues like #30 and #192. But that isn't enough for two reasons:
evalJavaScript
doesn't work on Android SDK versions below 19.evalJavaScript
must be run after the page has finished loading.
Proposal
Add a method that returns the title from the WebView. You can use WebView.getTitle() on Android and WKWebView.title on iOS to get it.
To know when the title is available, Android offers WebChromeClient.onReceivedTitle(). This should be forwarded to a new event on FlutterWebviewPlugin
. I don't know if there is something similar for iOS.
korchix and arok