Open the URL in a new tab. Running script
- Code: Select all
public BrowserMain(string address, bool newtabrequest)
{
InitializeComponent();
.....
WebBrowser.FrameLoadEnd += WebBrowserFrameLoadEnded;
}
private void WebBrowserFrameLoadEnded(object sender, FrameLoadEndEventArgs e)
{
if (e.Frame.IsMain)
{
WebBrowser.ExecuteScriptAsync("document.querySelectorAll('#ui > ul > li:nth-child(1) > div').forEach(function(i){ i.click()})" + ";");
}
}
waiting for script to run. But it happens that the application simply closes without errors. How do I run the script correctly after loading the page? Thank you