How to use the chrome-remote-interface.Activate 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 N0taN3rd / Squidwarc / lib / crawler / index.js View on Github external
static Activate (...args) {
    return CDP.Activate(...args)
  }
github N0taN3rd / Squidwarc / lib / remoteChrome.js View on Github external
static Activate (...args) {
    return CDP.Activate(...args)
  }
github JoshTheDerf / prerenderer / es6 / renderers / chrome.js View on Github external
async () => {
            const handler = await prepareTab(connectionOptions, `http://localhost:${rootOptions.server.port}${route}`, this._rendererOptions)
            handlers.push(handler)

            const {client, tab} = handler
            const {Runtime} = client

            await CRI.Activate(Object.assign({}, connectionOptions, {id: tab.id}))

            const {result} = await Runtime.evaluate({
              expression: `(${getPageContents})(${JSON.stringify(this._rendererOptions)}, '${route}')`,
              awaitPromise: true
            })

            const parsedResult = JSON.parse(result.value)

            await client.close()
            return Promise.resolve(parsedResult)
          }
        )
github JoshTheDerf / prerenderer / es5-autogenerated / renderers / chrome.js View on Github external
return _regenerator2.default.wrap(function _callee6$(_context6) {
                      while (1) {
                        switch (_context6.prev = _context6.next) {
                          case 0:
                            _context6.next = 2;
                            return prepareTab(connectionOptions, `http://localhost:${rootOptions.server.port}${route}`, _this3._rendererOptions);

                          case 2:
                            handler = _context6.sent;

                            handlers.push(handler);

                            client = handler.client, tab = handler.tab;
                            Runtime = client.Runtime;
                            _context6.next = 8;
                            return CRI.Activate(Object.assign({}, connectionOptions, { id: tab.id }));

                          case 8:
                            _context6.next = 10;
                            return Runtime.evaluate({
                              expression: `(${getPageContents})(${JSON.stringify(_this3._rendererOptions)}, '${route}')`,
                              awaitPromise: true
                            });

                          case 10:
                            _ref8 = _context6.sent;
                            result = _ref8.result;
                            parsedResult = JSON.parse(result.value);
                            _context6.next = 15;
                            return client.close();

                          case 15: