It was super easy to use. I just created a form then added the following code:
public ChromiumWebBrowser chromeBrowser;
CefSettings cefSettings = new CefSettings();
Cef.Initialize(cefSettings);
chromeBrowser = new ChromiumWebBrowser("INSERT_WEB_URL_HERE");
this.Controls.Add(chromeBrowser);
// fill the window minus the menu
chromeBrowser.Dock = DockStyle.None;
chromeBrowser.Top = menuStrip1.Height;
chromeBrowser.Height = this.ClientSize.Height - menuStrip1.Height;
chromeBrowser.Width = this.ClientSize.Width;
chromeBrowser.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
Then you can do things like this:
chromeBrowser.ExecuteScriptAsync("document.getElementById(\"ext-comp-1091\").click();"); // stats web menu item
Fun times.
No comments:
Post a Comment
Comments are moderated. We're only going to allow stuff that we find funny, interesting, or just plain for the heck of it. If you don't like that, feel free to leave.