我对C#还是很陌生,但Chromium正在加载网页,但是如果铬已初始化,我想执行javascript。
我没有找到有关IsBrowserInitializedChanged
的任何教程或解释,也不知道如何使用它。
[如果有人可以帮助我,我会很高兴。
private void InitChrome()
{
CefSettings settings = new CefSettings();
Cef.Initialize(settings);
}
public Main(String username, String password)
{
InitializeComponent();
InitChrome();
un = username;
pw = password;
chrome = new
ChromiumWebBrowser("https://www.thesite.com/#/auth/login");
pPanel.Controls.Add(chrome);
chrome.Dock = DockStyle.Fill;
chrome.ExecuteScriptAsync(File.ReadAllText(@"content\jquery-3.3.1.min.js"));
chrome.ExecuteScriptAsync(File.ReadAllText(@"content\javascript.js"));
}
我在CefSharp代码中发现了一名从事这项工作的成员
// Summary: Gets a value that indicates whether CefSharp is initialized.
public static bool IsInitialized { get; }