Skip to content
Snippets Groups Projects
Commit 2ced8a4d authored by Kevin Prudente's avatar Kevin Prudente Committed by GitHub
Browse files

Merge pull request #8 from quamotion/fixes/fix-build

Update the sample program to fix build
parents 27d0b066 917e9324
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,15 @@ ...@@ -24,6 +24,15 @@
public class CommandResponse<T> : CommandResponse public class CommandResponse<T> : CommandResponse
{ {
public CommandResponse()
{
}
public CommandResponse(T result)
{
this.Result = result;
}
public T Result public T Result
{ {
get; get;
......
using MasterDevs.ChromeDevTools.Protocol.Page; using MasterDevs.ChromeDevTools.Protocol.Chrome.Page;
using System; using System;
using System.Linq; using System.Linq;
...@@ -31,14 +31,14 @@ namespace MasterDevs.ChromeDevTools.Sample ...@@ -31,14 +31,14 @@ namespace MasterDevs.ChromeDevTools.Sample
// STEP 4 - Register for events (in this case, "Page" domain events) // STEP 4 - Register for events (in this case, "Page" domain events)
// send an event to tell chrome to send us all Page events // send an event to tell chrome to send us all Page events
// but we only subscribe to certain events in this session // but we only subscribe to certain events in this session
var pageEnableResult = chromeSession.SendAsync<ChromeDevTools.Protocol.Page.EnableCommand>().Result; var pageEnableResult = chromeSession.SendAsync<ChromeDevTools.Protocol.Chrome.Page.EnableCommand>().Result;
Console.WriteLine("PageEnable: " + pageEnableResult.Id); Console.WriteLine("PageEnable: " + pageEnableResult.Id);
chromeSession.Subscribe<Protocol.Page.DomContentEventFiredEvent>(domContentEvent => chromeSession.Subscribe<Protocol.Chrome.Page.DomContentEventFiredEvent>(domContentEvent =>
{ {
Console.WriteLine("DomContentEvent: " + domContentEvent.Timestamp); Console.WriteLine("DomContentEvent: " + domContentEvent.Timestamp);
}); });
// you might never see this, but that's what an event is ... right? // you might never see this, but that's what an event is ... right?
chromeSession.Subscribe<Protocol.Page.FrameStartedLoadingEvent>(frameStartedLoadingEvent => chromeSession.Subscribe<Protocol.Chrome.Page.FrameStartedLoadingEvent>(frameStartedLoadingEvent =>
{ {
Console.WriteLine("FrameStartedLoading: " + frameStartedLoadingEvent.FrameId); Console.WriteLine("FrameStartedLoading: " + frameStartedLoadingEvent.FrameId);
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment