From 2a55140d39d8f839e525c9973eca68f385ea97ae Mon Sep 17 00:00:00 2001 From: mehbark Date: Thu, 21 Sep 2023 23:44:26 -0400 Subject: [PATCH] bookmarks: THAT'S WHAT I WAS LOOKING FOR --- html/bookmarks.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/html/bookmarks.tsx b/html/bookmarks.tsx index e9eb338..b9c20e8 100644 --- a/html/bookmarks.tsx +++ b/html/bookmarks.tsx @@ -8,9 +8,10 @@ const try_so_so_hard_to_get_favicon_link = async ( const doc = new DOMParser().parseFromString(text, "text/html"); if (!doc) return; - let link = doc.querySelector('link[rel="icon"]'); - if (!link) link = doc.querySelector('link[id="favicon"]'); - if (!link) link = doc.querySelector('link[rel="shortcut icon"]'); + const link = + doc.querySelector('link[rel="icon"]') ?? + doc.querySelector('link[id="favicon"]') ?? + doc.querySelector('link[rel="shortcut icon"]'); if (!link) return; const href = link.getAttribute("href"); if (!href) return;