feat: show favicons for external chat links

Adds DuckDuckGo favicon lookup for external URLs
Shows favicons in markdown and fetch tool link rows
Hides missing icons automatically
This commit is contained in:
Bohdan Triapitsyn
2026-05-18 19:25:10 +03:00
parent 81c834d194
commit eb3c78e224
3 changed files with 60 additions and 5 deletions
+9
View File
@@ -28,6 +28,15 @@ export const isExternalHttpUrl = (url: string): boolean => {
return parsed.protocol === 'http:' || parsed.protocol === 'https:';
};
export const getExternalFaviconUrl = (url: string): string | null => {
const parsed = parseUrlSafely(url.trim());
if (!parsed || (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')) {
return null;
}
return `https://icons.duckduckgo.com/ip3/${parsed.hostname.toLowerCase()}.ico`;
};
const LOOPBACK_HOSTNAMES = new Set(['localhost', '127.0.0.1', '0.0.0.0', '::1']);
/**