fluttercommunity / fluttercommunity/flutter_webview_plugin

Add a method to get the title of the current page as soon as it's available

Abierto
#529 1 comentario 2 reacciones 0 asignados Ver en GitHub
feature request low
Lenguaje dominante
Java
Estrellas
1.5k
Forks
938
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## 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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Empieza leyendo la integración nativa de WebView y el flujo de eventos de FlutterWebviewPlugin. En Android, compara WebView.getTitle() con WebChromeClient.onReceivedTitle(); en iOS, investiga WKWebView.title y el mecanismo de actualización correspondiente. Se considera terminado cuando se puede recuperar el título actual y la disponibilidad del título se expone a través del plugin en ambas plataformas.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
android, ios, java
Área
mobile-dev
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.