Cefsharp.Winform,当我隐藏表单时,浏览器加载被取消。
有两种形式:MainForm和BrowserForm(来自此的Cefsharp.Winform)。当我调用Hide方法隐藏BrowserFrom时,会取消cefsharp.winform加载。
隐藏表单代码:
private void BrowserForm_AddressChanged(object sender, AddressChangedEventArgs e) {
var url = new Uri( e.Address );
if ("login.taobao.com".Equals( url.Host, StringComparison.OrdinalIgnoreCase )) {
return;
}
var browserForm = ( sender as Control ).Parent as BrowserForm;
if (browserForm.InvokeRequired) {
browserForm.Invoke( new MethodInvoker( delegate { browserForm.Hide(); } ) );
}
else { browserForm.Hide(); }
if ("myseller.taobao.com".Equals( url.Host, StringComparison.OrdinalIgnoreCase )) {
browserForm.LoadUrl( "https://law.taobao.com/rulefaces/rule_url_proxy.htm" );
return;
}
if ("law.taobao.com".Equals( url.Host, StringComparison.OrdinalIgnoreCase )) {
return;
}
browserForm.AddressChanged -= BrowserForm_AddressChanged;
AppController.ExecuteCollectionTask().Wait();
}
隐藏BrowserFrom之后是否有某种方法可以保持负载?
Cefsharp.Winform版本57.0 .net framework 4.5.2
感谢。