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;