docs: function collectResources(a, obj, tagName) {
          Array.prototype
              .forEach
              .call(a.ownerDocument.getElementsByTagName(tagName), function(r) {
                  // Get canonical URL
                  a.href = r.currentSrc || r.src || r.getAttribute("xlink:href") || r.href;
  
                  // only get external resource
                  if (a.href.match(/^https?:\/\//)) {
                      obj[a.href] = r;
                  }
              });
      }