void HandleWebViewDecidePolicyForNavigation (object sender, WebNavigatioPolicyEventArgs e)
{
if (LoadingFromString){
WebView.DecideUse (e.DecisionToken);
return;
}
var mainUrl = e.Frame.WebView.MainFrameUrl;
var url = e.Request.Url.AbsoluteString;
// Let WebKit take care of the anchors.
if (mainUrl != null && url.StartsWith (mainUrl) && url.Length > mainUrl.Length && url [mainUrl.Length] == '#'){
WebView.DecideUse (e.DecisionToken);
return;
}
Node match;
WebView.DecideIgnore (e.DecisionToken);
var res = DocTools.GetHtml (url, null, out match);
if (res == null)
return;
history.AppendHistory (new LinkPageVisit (this, url));
LoadHtml (res);
ShowNode (match);
}