1/* Shared public URL syntax normalization for the homepage and card page. */ 2(function (global) { 3 "use strict"; 4 5 global.xagentNormalizePublicUrl = function (value) { 6 var raw = String(value || "").trim(); 7 if (!raw) return ""; 8 if (!/^https?:\/\//i.test(raw)) raw = "https://" + raw; 9 try { 10 var url = new URL(raw); 11 if (url.protocol !== "http:" && url.protocol !== "https:") return ""; 12 if (!url.hostname || url.hostname.indexOf(".") === -1) return ""; 13 if (url.username || url.password) return ""; 14 return url.origin + (url.pathname === "/" ? "" : url.pathname); 15 } catch (_error) { 16 return ""; 17 } 18 }; 19})(window);
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.