bookmarks: THAT'S WHAT I WAS LOOKING FOR
This commit is contained in:
parent
66027ca65a
commit
2a55140d39
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue