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

      if (!this.document) {
        resolve(false);
        return;
      } // Check if link already exists


      $stylesheet = this.document.querySelector("link[href='" + src + "']");

      if ($stylesheet) {
        resolve(true);
        return; // already present
      }

      $stylesheet = this.document.createElement("link");
      $stylesheet.type = "text/css";
      $stylesheet.rel = "stylesheet";
      $stylesheet.href = src;

      $stylesheet.onload = $stylesheet.onreadystatechange = function () {
        if (!ready && (!this.readyState || this.readyState == "complete")) {
          ready = true; // Let apply

          setTimeout(() => {
            resolve(true);
          }, 1);
        }
      };

      this.document.head.appendChild($stylesheet);
    }.bind(this));
  }
Append a stylesheet link to the document head
@param {string} src url