Giter Site home page Giter Site logo

chrome-debugger's Introduction

Chrome Debugger

This is an interface that talks Chrome's Remote Debugging Protocol.

Usage

var cd = require('chrome-debugger')('ws://localhost:9222/devtools/page/123')
cd.runtime.evaluate('5', console.log.bind(console));
// 5

Also, see test.js.

API

  • require('chrome-debugger') - This returns a function that given a websocket endpoint for chrome, will return an object that can talk the debugger protocol.

    • console - By enabling the console, you can listen to messages from the console. This object is an event emitter, so, you can listen to messages such as Console.messageAdded, Console.messagesCleared, and Console.messageRepeatCountUpdated.
      • clearMessages - ([callback]) Clears the console
      • disable - ([callback]) Disable the console to stop receiving messages
      • enable - ([ callback]) Enable the console to start receiving messages. The callback will let you know whether the request was succeeded or not.
    • runtime - The runtime
      • callFunctionOn - (options, [, callback]), the expression on the page.
        • options
          • objectId - [required] object to call function on
          • functionDeclaration - [required] declaration of the function as a string
          • arguments - [optional] arguments to give to the call. Objects need to be remote objects as well
          • returnByValue - [optional] Should the return be returned by value, for example, JSON
      • evaluate - (options, [, callback]), evaluates the expression on the page.
        • options
          • expression - [required] The expression to evaluate
          • objectGroup - [optional] Symbolic group name to release objects
          • returnByValue - [optional] Should the return be returned by value, for example, JSON
      • getProperties - (remoteObjectId [, ownProperties [, callback]]), returns the properties of the given remote object
      • releaseObject - (remoteObjectId, [, callback]), releases a remote object
      • releaseObjectGroup - (objectGroup, [, callback]), releases a remote objectgroup

Developing

npm install

Afterwards, you can start developing on this.

LICENSE

MIT

chrome-debugger's People

Contributors

gkatsev avatar

Stargazers

 avatar

Watchers

 avatar  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.