# chrome-rdebug

> Full implementation of the chrome/webkit remote debugging protocol. Implemented to use as the bridge for AppJS v2.0

Latest version **0.0.14** (published 2013-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install chrome-rdebug
pnpm add chrome-rdebug
yarn add chrome-rdebug
bun add chrome-rdebug
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2013-11-18 |
| First published | 2013-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | sihorton |
| Maintainers | sihorton |
| Keywords | remote, debug |

## Links

- npm: https://www.npmjs.com/package/chrome-rdebug
- Repository: https://github.com/sihorton/chrome-rDebug
- Issues: https://github.com/sihorton/chrome-rDebug/issues
- npm.io page: https://npm.io/package/chrome-rdebug

## Dependencies (3)

- [q](https://npm.io/package/q.md) *
- [ws](https://npm.io/package/ws.md) *
- [request](https://npm.io/package/request.md) *

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.0.14 (latest) — 2013-11-18
- 0.0.13 — 2013-11-18
- 0.0.12 — 2013-11-18
- 0.0.11 — 2013-09-20
- 0.0.10 — 2013-09-19
- 0.0.9 — 2013-09-08
- 0.0.8 — 2013-09-08
- 0.0.6 — 2013-09-08
- 0.0.5 — 2013-09-08
- 0.0.4 — 2013-09-08
- 0.0.3 — 2013-09-08
- 0.0.2 — 2013-09-08
- 0.0.1 — 2013-09-08

## README

chrome-rDebug
=============

Api for using chrome remote debugging protocol. Written to provide a bridge api for AppJS v2.0

The API implements all methods detailed in the spec: https://developers.google.com/chrome-developer-tools/docs/protocol/1.0/

Example Code:
-------------
      
    var rDebug = require('./index.js').rDebug;
    var request = require("request");
     
    request("http://localhost:9222/json", function(error, response, body) {
        var chromeDebugOptions = JSON.parse(body);
        var chromeDebugUrl = chromeDebugOptions[0].webSocketDebuggerUrl;
        var rDebugApi = rDebug.openSocket(chromeDebugUrl);

        rDebugApi.ws.on('close',function() {
            console.log('disconnected');
        });
        var printErr = function(err) {
            console.log("error:"+err.error.code+" "+err.error.message);
        };
        rDebugApi.on('*',function(event) {
            console.log("Event:",event);
        });
        rDebugApi.ws.on('open',function() {
            console.log('connected');
            
            rDebugApi.domGetDocument().then(function(doc) {
                rDebugApi.domGetOuterHTML(doc.root.nodeId)
                .then(function(res) {
                    console.log("page html:",res.outerHTML);
                    rDebugApi.pageNavigate("http://appjs.com").then(function() {
                        setTimeout(function(){
                            rDebugApi.pageNavigate("about:blank")
                        },5000);
                    }).fail(function(err) {
                    console.log("error:"+err.error.code+" "+err.error.message);
                    });
                }).fail(function(err) {
                    console.log("error:"+err.error.code+" "+err.error.message);
                });
            }).fail(printErr);
        });
    });


Page Api:
=========

* pageNavigate(url)
* pageReload
* pageDisableEvents
* pageEnableEvents
 
Console Api:
============
* consoleClearMessages
* consoleEnable
* consoleDisable

DOM Api:
========
* domGetDocument
* domGetOuterHTML
* domHideHighlight
* domHighlightNode
* domHighlightRect
* domMoveTo
* domQuerySelector
* domQuerySelectorAll
* domRemoveAttribute
* domRemoveNode
* domRequestChildNodes
* domRequestNode
* domResolveNode
* domSetAttributeValue
* domSetAttributesAsText
* domSetNodeName
* domSetNodeValue
* domSetOutputHTML

DOM Debugger Api:
=================
* domDebuggerRemoveDomBreakpoint
* domDebuggerRemoveEventListenerBreakpoint
* domDebuggerRemoveXHRBreakpoint
* domDebuggerSetDomBreakpoint
* domDebuggerSetEventListenerBreakpoint
* domDebuggerSetXHRBreakpoint 

Runtime Api:
============
* runtimeCallFunctionOn
* runtimeEvaluate
* runtimeGetProperties
* runtimeReleaseObject
* runtimeReleaseObjectGroup 

Timeline Api:
=============
* timelineStart
* timelineEnd

Network Api:
============
* networkCanClearBrowserCache
* networkCanClearBrowserCookies
* networkClearBrowserCache
* networkClearBrowserCookies
* networkEnableEvents
* networkDisableEvents
* networkGetResponseBody
* networkSetCacheDisabled
* networkSetExtraHTTPHeaders
* networkSetUserAgentOverride

Event Api:
==========
Register to handle a given event, use '*' to handle all events.

Event Api Example code:-

    rDebugApi.on('DOM.documentUpdated',function(event) {
        console.log("Event:document updated");
    });
    rDebugApi.on('*',function(event) {
        //fired for all events.
        console.log("Event:",event);
    });

Methods like consoleEnable will turn on console events so you can handle them. consoleDisable and similar functions will then turn off those events.

---
_Source: https://npm.io/package/chrome-rdebug · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
