bookmarks: THAT'S WHAT I WAS LOOKING FOR

This commit is contained in:
mehbark 2023-09-21 23:44:26 -04:00
parent 66027ca65a
commit 2a55140d39

View file

@ -8,9 +8,10 @@ const try_so_so_hard_to_get_favicon_link = async (
const doc = new DOMParser().parseFromString(text, "text/html"); const doc = new DOMParser().parseFromString(text, "text/html");
if (!doc) return; if (!doc) return;
let link = doc.querySelector('link[rel="icon"]'); const link =
if (!link) link = doc.querySelector('link[id="favicon"]'); doc.querySelector('link[rel="icon"]') ??
if (!link) link = doc.querySelector('link[rel="shortcut icon"]'); doc.querySelector('link[id="favicon"]') ??
doc.querySelector('link[rel="shortcut icon"]');
if (!link) return; if (!link) return;
const href = link.getAttribute("href"); const href = link.getAttribute("href");
if (!href) return; if (!href) return;