src/connectors/appscript-connector.js
/**
   * requestApiKey - Request for WebPageTest API key.
   * @param  {string} message Message for the UI prompt.
   */
Request for WebPageTest API key.
@param  {string} message Message for the UI prompt.
Request for WebPageTest API key . @param { string } message Message for the UI prompt .
requestApiKey(message, errorMessage) {
    let apiKey = this.getEnvVar('webPageTestApiKey');
    message = message || 'Enter your WebPageTest API Key';
    let requestCount = 0;
    while (!apiKey && requestCount < 3) {
      let input = Browser.inputBox(message);
      if (input !== 'cancel') {
        apiKey = input;
      } else {
        break;
      }
      requestCount++;
    }
    if (apiKey) {
      this.setEnvVar('webPageTestApiKey', apiKey);
    } else {
      errorMessage = errorMessage || 'A WebPageTest API Key is required ' +
          'for this tool to function.';
      Browser.msgBox(errorMessage);
    }
  }
requestApiKey ( message , errorMessage ) { let apiKey = this . getEnvVar ( 'webPageTestApiKey' ) ; message = message || 'Enter your WebPageTest API Key' ; let requestCount = 0 ; while ( ! apiKey && requestCount < 3 ) { let input = Browser . inputBox ( message ) ; if ( input !== 'cancel' ) { apiKey = input ; } else { break ; } requestCount ++ ; } if ( apiKey ) { this . setEnvVar ( 'webPageTestApiKey' , apiKey ) ; } else { errorMessage = errorMessage || 'A WebPageTest API Key is required ' + 'for this tool to function.' ; Browser . msgBox ( errorMessage ) ; } }
requestApiKey - Request for WebPageTest API key.
requestApiKey - Request for WebPageTest API key .
// The input will be 'cancel' if the user uses the close button on top