addScript(src) {
    return new Promise(function (resolve, reject) {
      var $script;
      var ready = false;

      if (!this.document) {
        resolve(false);
        return;
      }

      $script = this.document.createElement("script");
      $script.type = "text/javascript";
      $script.async = true;
      $script.src = src;

      $script.onload = $script.onreadystatechange = function () {
        if (!ready && (!this.readyState || this.readyState == "complete")) {
          ready = true;
          setTimeout(function () {
            resolve(true);
          }, 1);
        }
      };

      this.document.head.appendChild($script);
    }.bind(this));
  }
Append a script tag to the document head
@param {string} src url
@returns {Promise} loaded