From 39629006a7ac949833cc0ff36673461fe1f33af8 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Sun, 8 Feb 2026 12:26:12 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=BD=EB=A1=9C=20=EA=B8=B0=EB=B0=98=20?= =?UTF-8?q?=ED=8C=8C=EB=B9=84=EC=BD=98=20=EC=A7=80=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ncue.net 및 하위 도메인에서 /{첫경로}/favicon.ico 우선 사용 - index.html 폴백 모드에서도 파비콘 이미지 렌더링 및 실패 시 글자 폴백 Co-authored-by: Cursor --- index.html | 18 +++++++++++++++++- script.js | 6 ++++++ 2 files changed, 23 insertions(+), 1 deletion(-) 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 "";