1function logError(message, callback) { 2 const domainParts = window.location.hostname.split("."); 3 const mainDomain = domainParts[domainParts.length - 2] + "." + domainParts[domainParts.length - 1]; 4 5 $.ajax({ 6 type: "POST", 7 dataType: "json", 8 contentType: "application/json;charset=utf-8", 9 url: `${window.location.protocol}//cmgw.${mainDomain}/api/track/ClientLog`, 10 data: JSON.stringify({ 11 message: message, 12 level: "error", 13 page: "Header", 14 host: window.location.host, 15 path: window.location.pathname, 16 queryString: window.location.search, 17 scheme: window.location.protocol.replace(":", "") 18 }), 19 }).always(function () { 20 typeof callback === 'function' && callback(); 21 });; 22} 23 24(function monitorResourceLoad() { 25 if (enabledClientLog) { 26 window.addEventListener("error", (e) => { 27 logError("Odin onError " + e.message + ". " + e.error?.stack); 28 }); 29 30 function listenForLoadError(node) { 31 if (["SCRIPT", "LINK"].indexOf(node.tagName) >= 0) { 32 var origOnError = node.onerror; 33 node.onerror = function (e) { 34 if (!e || !e.srcElement) { return; } 35 e.path = e.path || []; 36 37 logError("Failed to load " + e.srcElement.tagName + ": " + (e.srcElement.src || e.srcElement.href)); 38 39 if (origOnError) { origOnError.call(node, e); } 40 } 41 } 42 } 43 var Observer = window.MutationObserver || window.WebKitMutationObserver; 44 if (!Observer) { return; } 45 new Observer((function (mutations) { 46 [].forEach.call(mutations, function (mutation) { 47 [].forEach.call(mutation.addedNodes, listenForLoadError); 48 }); 49 })).observe(document, { childList: true, subtree: true }); 50 } 51})();
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.