How to use the chrome-remote-interface/lib/protocol.json.domains function in chrome-remote-interface

To help you get started, we’ve selected a few chrome-remote-interface examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gwuhaolin / chrome-pool / index.js View on Github external
'use strict';
const net = require('net');
const { launchWithHeadless, launchWithoutNoise } = require('chrome-runner');
const chrome = require('chrome-remote-interface');
const ProtocolDomains = require('chrome-remote-interface/lib/protocol.json').domains;

/**
 * launch Chrome
 */
async function launchChrome(runnerOptions) {
  let runner;
  if (process.env.SHOW_CHROME) {
    runner = await launchWithoutNoise(runnerOptions);
  } else {
    runner = await launchWithHeadless(runnerOptions);
  }
  return runner;
}

/**
 * chrome remote interface protocols data, enable should enable protocols before use