static beginMessage(frame, message, callback, timeout = 1000) {
    let messageId = Utils.createUUID();

    if (!frame || !frame.postMessage) {
      Logger.error(
        '`frame` must be a Window object that we can post the message to.'
      );
      return;
    }
    if (callback && typeof callback !== 'function') {
      Logger.error('`callback` must be a function, or undefined.');
      return;
    }
    message = message || null;
    timeout = Math.max(timeout, 0);

    let timeoutId = setTimeout(() => {
      this._timeoutMessage(messageId);
    }, timeout);

    _messages[messageId] = {
      messageId: messageId,
      frame: frame,
      message: message,
      callback: callback,
      timeout: timeout,
      timeoutId: timeoutId,
      isFulfilled: false,
      didTimeout: false
    };

    frame.postMessage(
      { version: this._versionKey, messageId: messageId, message: message },
      '*'
    );
  }
/**
   * Sends a new message to another frame.
   *
   * @param {Window} frame      - Frame to send the message to
   * @param {Object} message    - Data to send to the other frame
   * @param {Function} callback - Callback to fire if/when message is returned
   * @param {number=} timeout   - Override the number of ms before the message times out
   * @returns {void}
   */
Sends a new message to another frame.
Sends a new message to another frame .
static beginMessage(frame, message, callback, timeout = 1000) {
    let messageId = Utils.createUUID();
    if (!frame || !frame.postMessage) {
      Logger.error(
        '`frame` must be a Window object that we can post the message to.'
      );
      return;
    }
    if (callback && typeof callback !== 'function') {
      Logger.error('`callback` must be a function, or undefined.');
      return;
    }
    message = message || null;
    timeout = Math.max(timeout, 0);
    let timeoutId = setTimeout(() => {
      this._timeoutMessage(messageId);
    }, timeout);
    _messages[messageId] = {
      messageId: messageId,
      frame: frame,
      message: message,
      callback: callback,
      timeout: timeout,
      timeoutId: timeoutId,
      isFulfilled: false,
      didTimeout: false
    };
    frame.postMessage(
      { version: this._versionKey, messageId: messageId, message: message },
      '*'
    );
  }
static beginMessage ( frame , message , callback , timeout = 1000 ) { let messageId = Utils . createUUID ( ) ; if ( ! frame || ! frame . postMessage ) { Logger . error ( '`frame` must be a Window object that we can post the message to.' ) ; return ; } if ( callback && typeof callback !== 'function' ) { Logger . error ( '`callback` must be a function, or undefined.' ) ; return ; } message = message || null ; timeout = Math . max ( timeout , 0 ) ; let timeoutId = setTimeout ( ( ) => { this . _timeoutMessage ( messageId ) ; } , timeout ) ; _messages [ messageId ] = { messageId : messageId , frame : frame , message : message , callback : callback , timeout : timeout , timeoutId : timeoutId , isFulfilled : false , didTimeout : false } ; frame . postMessage ( { version : this . _versionKey , messageId : messageId , message : message } , '*' ) ; }
Sends a new message to another frame.
Sends a new message to another frame .