fedimbed: more icon debug

This commit is contained in:
Cynthia Foxwell 2025-04-05 11:29:17 -06:00
parent bd53470503
commit c8c73baa24
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -1242,6 +1242,7 @@ async function processUrl(msg, url, spoiler = false, command = false) {
if (headTag) { if (headTag) {
for (const tag of headTag.link) { for (const tag of headTag.link) {
if (tag.$rel == "icon" || tag.$rel == "apple-touch-icon") { if (tag.$rel == "icon" || tag.$rel == "apple-touch-icon") {
logger.verbose("fedimbed", `icon tag: ${JSON.stringify(tag)}`);
if (tag.$sizes) { if (tag.$sizes) {
const [w, h] = tag.$sizes.split("x").map(parseInt); const [w, h] = tag.$sizes.split("x").map(parseInt);
const size = w * h; const size = w * h;
@ -1268,11 +1269,13 @@ async function processUrl(msg, url, spoiler = false, command = false) {
} }
} }
logger.verbose("fedimbed", `icon pre: ${icon}`);
if (icon && icon.startsWith("/")) { if (icon && icon.startsWith("/")) {
icon = urlObj.origin + icon; icon = urlObj.origin + icon;
} }
logger.verbose("fedimbed", `icon: ${icon}`); logger.verbose("fedimbed", `icon post: ${icon}`);
const baseEmbed = { const baseEmbed = {
color, color,