src/resourcetiming-compression.js
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;
                }
            });
    }
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;
                }
            });
    }
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 ; } } ) ; }
Collect external resources by tagName

@param {Element} a an anchor element
@param {Object} obj object of resources where the key is the url
@param {string} tagName tag name to collect
Collect external resources by tagName