diff --git a/index.html b/index.html index 71a3a45..33f3626 100644 --- a/index.html +++ b/index.html @@ -516,6 +516,18 @@ const favTag = link.favorite ? `★ 즐겨찾기` : ""; const lockTag = accessible ? "" : `접근 제한`; const letter = esc((link.title || d || "L").trim().slice(0, 1).toUpperCase()); + function faviconUrl(rawUrl) { + try { + const uu = new URL(String(rawUrl || "")); + const host = String(uu.hostname || "").toLowerCase(); + const isNcue = host === "ncue.net" || host.endsWith(".ncue.net"); + const parts = uu.pathname.split("/").filter(Boolean); + if (isNcue && parts.length) return `${uu.origin}/${parts[0]}/favicon.ico`; + return `${uu.origin}/favicon.ico`; + } catch { + return ""; + } + } function buildOpenUrl(rawUrl) { const url0 = String(rawUrl || "").trim(); if (!url0) return ""; @@ -539,11 +551,15 @@ ? `열기` : ``; const copyAttrs = accessible ? "" : ` disabled aria-disabled="true" title="이 링크는 현재 권한으로 접근할 수 없습니다."`; + const fav = faviconUrl(link.url); + const faviconHtml = fav + ? `` + : `
${letter}
`; return `
- +
${t}
${d}
diff --git a/script.js b/script.js index c6edfc8..a6c192d 100644 --- a/script.js +++ b/script.js @@ -184,6 +184,12 @@ function faviconUrl(url) { try { const u = new URL(url); + // default: site root favicon + // special: allow per-path favicon like https://ncue.net/dsyoon/favicon.ico (internal only) + const host = String(u.hostname || "").toLowerCase(); + const isNcue = host === "ncue.net" || host.endsWith(".ncue.net"); + const parts = u.pathname.split("/").filter(Boolean); + if (isNcue && parts.length) return `${u.origin}/${parts[0]}/favicon.ico`; return `${u.origin}/favicon.ico`; } catch { return "";