sendDevToolsMessage(method, params = {}) {
    let id = this.commandId_;
    // We increment by two because these bindings are intended to be used in
    // conjunction with HeadlessDevToolsClient::RawProtocolListener and using
    // odd numbers for js generated IDs lets the implementation of =
    // OnProtocolMessage easily distinguish between C++ and JS generated
    // commands and route the response accordingly.
    this.commandId_ += 2;
    if (this.validator_) {
      this.validator_(method, params);
    }
    // Note the names are in quotes to prevent closure compiler name mangling.
    this.transport_.send(
        JSON.stringify({'method': method, 'id': id, 'params': params}));
    return new Promise((resolve, reject) => {
      this.pendingCommands_.set(id, {resolve: resolve, reject: reject});
    });
  }
/**
   * Issues a DevTools protocol command and returns a promise for the results.
   *
   * @param {string} method The name of the DevTools protocol command method.
   * @param {!Object=} params An object containing the command parameters if
   *     any.
   * @return {!Promise<!TYPE>} A promise for the results object.
   * @template TYPE
   */
Issues a DevTools protocol command and returns a promise for the results.
@param {string} method The name of the DevTools protocol command method.
@param {!Object=} params An object containing the command parameters if
any.
@return {!Promise} A promise for the results object.
@template TYPE
Issues a DevTools protocol command and returns a promise for the results . @param { string } method The name of the DevTools protocol command method . @param { !Object = } params An object containing the command parameters if any . @return { !Promise } A promise for the results object . @template TYPE
sendDevToolsMessage(method, params = {}) {
    let id = this.commandId_;
    this.commandId_ += 2;
    if (this.validator_) {
      this.validator_(method, params);
    }
    this.transport_.send(
        JSON.stringify({'method': method, 'id': id, 'params': params}));
    return new Promise((resolve, reject) => {
      this.pendingCommands_.set(id, {resolve: resolve, reject: reject});
    });
  }
sendDevToolsMessage ( method , params = { } ) { let id = this . commandId_ ; this . commandId_ += 2 ; if ( this . validator_ ) { this . validator_ ( method , params ) ; } this . transport_ . send ( JSON . stringify ( { 'method' : method , 'id' : id , 'params' : params } ) ) ; return new Promise ( ( resolve , reject ) => { this . pendingCommands_ . set ( id , { resolve : resolve , reject : reject } ) ; } ) ; }
Issues a DevTools protocol command and returns a promise for the results.
Issues a DevTools protocol command and returns a promise for the results .
// We increment by two because these bindings are intended to be used in // conjunction with HeadlessDevToolsClient::RawProtocolListener and using // odd numbers for js generated IDs lets the implementation of = // OnProtocolMessage easily distinguish between C++ and JS generated // commands and route the response accordingly. // Note the names are in quotes to prevent closure compiler name mangling.