fluttercommunity / fluttercommunity/flutter_webview_plugin
Add a method to get the title of the current page as soon as it's available
- 主要言語
- Java
- スター
- 1.5k
- フォーク
- 938
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
## 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:
1. `evalJavaScript` doesn't work on Android SDK versions below 19.
2. `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()](https://developer.android.com/reference/android/webkit/WebView.html#getTitle()) on Android and [WKWebView.title](https://developer.apple.com/documentation/webkit/wkwebview/1415015-title) on iOS to get it.
To know when the title is available, Android offers [WebChromeClient.onReceivedTitle()](https://developer.android.com/reference/android/webkit/WebChromeClient#onReceivedTitle(android.webkit.WebView,%20java.lang.String)). This should be forwarded to a new event on `FlutterWebviewPlugin`. I don't know if there is something similar for iOS.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず、ネイティブの WebView 統合と FlutterWebviewPlugin のイベントフローを読みます。Android では、WebView.getTitle() と WebChromeClient.onReceivedTitle() を比較します。iOS では、WKWebView.title と対応する更新メカニズムを調査します。両方のプラットフォームで現在のタイトルを取得でき、タイトルの利用可能性がプラグインを通じて公開されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, ios, java
- 領域
- mobile-dev
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100