Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ChromeDevTools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FrameIT
ChromeDevTools
Commits
57890a7e
Commit
57890a7e
authored
8 years ago
by
Frederik Carlier
Browse files
Options
Downloads
Patches
Plain Diff
Update the sample program, now that the Chrome protocol lives in its own namespace
parent
27d0b066
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Sample/Program.cs
+4
-4
4 additions, 4 deletions
source/Sample/Program.cs
with
4 additions
and
4 deletions
source/Sample/Program.cs
+
4
−
4
View file @
57890a7e
using
MasterDevs.ChromeDevTools.Protocol.Page
;
using
MasterDevs.ChromeDevTools.Protocol.
Chrome.
Page
;
using
System
;
using
System.Linq
;
...
...
@@ -31,14 +31,14 @@ namespace MasterDevs.ChromeDevTools.Sample
// STEP 4 - Register for events (in this case, "Page" domain events)
// send an event to tell chrome to send us all Page events
// 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
);
chromeSession
.
Subscribe
<
Protocol
.
Page
.
DomContentEventFiredEvent
>(
domContentEvent
=>
chromeSession
.
Subscribe
<
Protocol
.
Chrome
.
Page
.
DomContentEventFiredEvent
>(
domContentEvent
=>
{
Console
.
WriteLine
(
"DomContentEvent: "
+
domContentEvent
.
Timestamp
);
});
// 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
);
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment