1/*! loadCSS rel=preload polyfill. [c]2017 Filament Group, Inc. MIT License */ 2(function( w ){ 3 // rel=preload support test 4 if( !w.loadCSS ){ 5 return; 6 } 7 var rp = loadCSS.relpreload = {}; 8 rp.support = function(){ 9 try { 10 return w.document.createElement( "link" ).relList.supports( "preload" ); 11 } catch (e) { 12 return false; 13 } 14 }; 15 16 // loop preload links and fetch using loadCSS 17 rp.poly = function(){ 18 var links = w.document.getElementsByTagName( "link" ); 19 for( var i = 0; i < links.length; i++ ){ 20 var link = links[ i ]; 21 if( link.rel === "preload" && link.getAttribute( "as" ) === "style" ){ 22 w.loadCSS( link.href, link, link.getAttribute( "media" ) ); 23 link.rel = null; 24 } 25 } 26 }; 27 28 // if link[rel=preload] is not supported, we must fetch the CSS manually using loadCSS 29 if( !rp.support() ){ 30 rp.poly(); 31 var run = w.setInterval( rp.poly, 300 ); 32 if( w.addEventListener ){ 33 w.addEventListener( "load", function(){ 34 rp.poly(); 35 w.clearInterval( run ); 36 } ); 37 } 38 if( w.attachEvent ){ 39 w.attachEvent( "onload", function(){ 40 w.clearInterval( run ); 41 } ) 42 } 43 } 44}( this ));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.