Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the page title in WebBrowser control?

How can I get the page title in a WebBrowser control when I navigate to different websites?


xmlns

xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"

Properties starting with D

DataContext
DesiredSize
Dispatcher
DoubleTap

xaml tag

<phone:WebBrowser Name="browser" Height="760" VerticalAlignment="Top"></phone:WebBrowser>
like image 973
BrunoLM Avatar asked Oct 08 '11 19:10

BrunoLM


1 Answers

I had the same problem. @Akash Kava's answer is almost correct but this is the correct javascript to read the html title:

String title = (string)browser.InvokeScript("eval", "document.title.toString()");
like image 53
Mikko Lassila Avatar answered Oct 21 '22 21:10

Mikko Lassila