C# Library to interact with the Chrome Developer Tools.
chromeSession.Subscribe<Protocol.Page.DomContentEventFiredEvent>(domContentEvent =>
{
Console.WriteLine("DomContentEvent: " + domContentEvent.Timestamp);
});
chromeSession.SendAsync(new NavigateCommand
{
Url = "http://www.google.com"
}).Wait();
This library is C# API that enabled interaction with the Chrome Developer Tools. When the Chrome Developer Tools are started, the chrome process starts a server. The Chrome Developer Tools UI communicates with this server via Web Sockets. So can you. In fact, everything in the Chrome Developers Tools UI is available to you via JSON, by default. This library makes it available to you in C#.
Communication with this server is defined in a protocol.json file. This is subject to change at any time. Below are instructions what to do if this library becomes out of date with the protocol.
Contained in this repo are 3 projects.
protocol.json
file and generates all of the classes in the ProtocolI've included a code example. Check it out and read no further. Wait, no. Keep reading!
The Chrome Developer Tools have a pretty cool API. There are 2 basic types of objects that the Developer Tools understand:
If you made it this far, it's best to read the sample - Program.cs.
If you didn't read the entire README (I don't blame you, I wouldn't), I've included a project in this repository which allows anyone to rebuild the protocol. Following these steps:
protocol.json
file and replace this oneOutputProtocol
directory and paste it into (overwrite everything!) the Protocol directory