Sha256: 9c901002724766023c46f15171e6386942c5d9effb851bf1c2f284ee816ab3a9

Contents?: true

Size: 1.33 KB

Versions: 12

Compression:

Stored size: 1.33 KB

Contents

'use strict';

const EventEmitter = require('events');
const dns = require('dns');

const devtools = require('./lib/devtools.js');
const Chrome = require('./lib/chrome.js');

// XXX reset the default that has been changed in
// (https://github.com/nodejs/node/pull/39987) to prefer IPv4. since
// implementations alway bind on 127.0.0.1 this solution should be fairly safe
// (see #467)
if (dns.setDefaultResultOrder) {
    dns.setDefaultResultOrder('ipv4first');
}

function CDP(options, callback) {
    if (typeof options === 'function') {
        callback = options;
        options = undefined;
    }
    const notifier = new EventEmitter();
    if (typeof callback === 'function') {
        // allow to register the error callback later
        process.nextTick(() => {
            new Chrome(options, notifier);
        });
        return notifier.once('connect', callback);
    } else {
        return new Promise((fulfill, reject) => {
            notifier.once('connect', fulfill);
            notifier.once('error', reject);
            new Chrome(options, notifier);
        });
    }
}

module.exports = CDP;
module.exports.Protocol = devtools.Protocol;
module.exports.List = devtools.List;
module.exports.New = devtools.New;
module.exports.Activate = devtools.Activate;
module.exports.Close = devtools.Close;
module.exports.Version = devtools.Version;

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.8.2 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.8.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.8.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.8.0.beta1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.7.4 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.8.0.alpha1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.7.3 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.7.2 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.7.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.7.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.7.0.rc1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js