1/** 2 * Global fallback script loader for Firefox Enhanced Tracking Protection 3 * This function dynamically loads fallback scripts when primary CDN sources fail 4 * 5 * Usage: loadFallbacks('/local/script1.js', '/local/script2.js', ...) 6 * 7 * @param {string} src - First script source URL to load 8 * @param {...string} Additional script sources to load sequentially 9 */ 10function loadFallbacks(src) { 11 var moreSrcs = Array.prototype.slice.call(arguments, 1); 12 var tag = document.createElement("script"); 13 tag.src = src; 14 tag.type = "text/javascript"; 15 16 if (moreSrcs.length > 0) { 17 var self = this; 18 tag.onload = function() { 19 loadFallbacks.apply(self, moreSrcs); 20 }; 21 tag.onerror = function() { 22 console.error('Failed to load fallback script: ' + src + '. Stopping fallback chain.'); 23 // Do not continue loading remaining scripts if this one fails 24 }; 25 } 26 27 document.head.appendChild(tag); 28}
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.