Sha256: aeb59b2fa95bb470d45c6da54b5b5c8caf01170089234895a155413e65645c16

Contents?: true

Size: 1.17 KB

Versions: 35

Compression:

Stored size: 1.17 KB

Contents

'use strict';

const EventEmitter = require('events');

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

module.exports = function (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(function () {
            new Chrome(options, notifier);
        });
        return notifier.once('connect', callback);
    } else {
        return new Promise(function (fulfill, reject) {
            notifier.once('connect', fulfill);
            notifier.once('error', reject);
            new Chrome(options, notifier);
        });
    }
};

// for backward compatibility
module.exports.listTabs = devtools.List;
module.exports.spawnTab = devtools.New;
module.exports.closeTab = devtools.Close;

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

35 entries across 35 versions & 2 rubygems

Version Path
opal-1.1.0.rc1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.0.5 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.0.4 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.0.3 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.0.2 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.0.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.0.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-1.0.0.beta1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-0.11.4 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-0.11.3 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-0.11.2 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-0.11.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-0.11.1.pre lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
opal-0.11.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js
dragonfly_chrome_headless-0.2.0 node_modules/chrome-remote-interface/index.js