processTitle function
Implementation
void processTitle(Document document, SnapView view) {
if (view.title != 'Unknown') {
return;
}
if (document.head != null) {
final titles = document.head!.children
.where((element) => element.localName == 'title')
.toList();
if (titles.isNotEmpty) {
view.title = titles.first.innerHtml;
}
}
}