code: function write(src, contents) {
        if (contents) {
          var script = '<script type="module" crossorigin>' + contents + '</' +
              'script>';
          doc.write(
              goog.TRUSTED_TYPES_POLICY_ ?
                  goog.TRUSTED_TYPES_POLICY_.createHTML(script) :
                  script);
        } else {
          var script = '<script type="module" crossorigin src="' + src + '"></' +
              'script>';
          doc.write(
              goog.TRUSTED_TYPES_POLICY_ ?
                  goog.TRUSTED_TYPES_POLICY_.createHTML(script) :
                  script);
        }
      }
docs: TODO(johnplaisted): Does document.writing really speed up anything? Any difference between this and just waiting for interactive mode and then appending?