GithubHelp home page GithubHelp logo

5l1v3r1 / chromedevtools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masterdevs/chromedevtools

0.0 1.0 0.0 3.37 MB

.NET library to interact with the Chrome Debugger

License: MIT License

C# 100.00%

chromedevtools's Introduction

NuGet version

ChromeDevTools

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();

About

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.

Contents

Contained in this repo are 3 projects.

How it works

I've included a code example. Check it out and read no further. Wait, no. Keep reading!

Chrome Developer Tools

The Chrome Developer Tools have a pretty cool API. There are 2 basic types of objects that the Developer Tools understand:

  • Events
    • These events will only be received by you
    • The are events triggered by page events, network events, the DOM, or something else.
    • You can tell Chrome to enable, or disable, domain events using ... commands (keep reading)
  • Commands
    • A command is an object that you will send to the Developer Tools. This command will generate a response (or an error response).
    • Every Command has a CommandResponse

MasterDevs.ChromeDevTools

If you made it this far, it's best to read the sample - Program.cs.

Library out of date?

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:

  1. Download the latest protocol.json file and replace this one
  2. Build & run MasterDevs.ChromeDevTools.ProtocolParser
  3. Copy the contents of the OutputProtocol directory and paste it into (overwrite everything!) the Protocol directory
  4. Submit a pull request so others can benefit! (optional)

Resources

chromedevtools's People

Contributors

brewdente avatar bvandorf avatar georgiosd avatar qmfrederik avatar svatal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.