我正在我的应用程序中使用Cefsharp Offscreen。文档中提供的加载页面的代码是:
const string testUrl = "https://github.com/cefsharp/CefSharp/wiki/Quick-Start";
var settings = new CefSettings()
{
//By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
};
//Perform dependency check to make sure all relevant resources are in our output directory.
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);
// Create the offscreen Chromium browser.
browser = new ChromiumWebBrowser(testUrl);
// An event that is fired when the first page is finished loading.
// This returns to us from another thread.
browser.LoadingStateChanged += BrowserLoadingStateChanged;
Cef.Shutdown();
但我想要这样的东西
browser = new ChromiumWebBrowser(); //without testUrl
// and then
browser.Load(testUrl).Wait();// and wait something like that;
// load url and wait unit page is fully loaded then go to next line
我找不到任何解决方案。