From f4e92e313a1d0e4a7f21d3977ff653920aab1052 Mon Sep 17 00:00:00 2001 From: KoloMl Date: Sun, 30 Aug 2026 07:13:21 +0200 Subject: [PATCH] Filling mapping of FA icons to different domains Partially ported this list from the Philomena source code. --- .../components/philomena/dupe/DupeDiff.ts | 135 +++++++++++++++++- 1 file changed, 129 insertions(+), 6 deletions(-) diff --git a/src/content/components/philomena/dupe/DupeDiff.ts b/src/content/components/philomena/dupe/DupeDiff.ts index d2a397e..c4f73d9 100644 --- a/src/content/components/philomena/dupe/DupeDiff.ts +++ b/src/content/components/philomena/dupe/DupeDiff.ts @@ -3,9 +3,6 @@ import { createFontAwesomeIcon } from "$lib/dom-utils"; const brandsSubtype = 'brands'; -const blueskyIcon = ['bluesky', brandsSubtype]; -const twitterIcon = ['x-twitter', brandsSubtype]; - export default class DupeDiff extends BaseComponent { #sourcesLine: HTMLElement | null = null; #ratingsLine: HTMLElement | null = null; @@ -101,9 +98,135 @@ export default class DupeDiff extends BaseComponent { return sourceIcon; } + /** + * Mirroring of mapping from source URL domains to appropriate FontAwesome icons which is used in Philomena. Doesn't + * match 1-to-1, but pretty close. + * + * Keys are the icons and values are the patterns extension should check for each URL. + */ static #iconsToPatternsMap = new Map([ - [blueskyIcon, 'bsky.app'], - ['paw', 'furaffinity.net'], - [twitterIcon, ['x.com', 'twitter.com']], + [ + ['artstation', brandsSubtype], + 'artstation.com' + ], + [ + 'bed', + 'pillowfort.social', + ], + [ + 'bolt-lightning', + 'boosty.to', + ], + [ + ['bluesky', brandsSubtype], + 'bsky.app', + ], + [ + 'brush', + ['artfight.net', 'newgrounds.com'], + ], + [ + 'coffee', + ['ko-fi.com', 'buymeacoffee.com'], + ], + [ + ['deviantart', brandsSubtype], + ['deviantart.com', 'sta.sh', 'fav.me'], + ], + [ + ['discord', brandsSubtype], + ['discordapp.com', 'discord.com', 'discord.gg'], + ], + [ + 'dove', + 'itaku.ee', + ], + [ + ['etsy', brandsSubtype], + 'etsy.com', + ], + [ + ['facebook', brandsSubtype], + ['facebook.com', 'fb.me'], + ], + [ + ['flickr', brandsSubtype], + 'flickr.com', + ], + [ + ['instagram', brandsSubtype], + 'instagram.com', + ], + [ + ['mastodon', brandsSubtype], + [ + 'awoo.space', + 'bark.light', + 'equestria.social', + 'mastodon.social', + 'meow.social', + 'pawoo.net', + 'pettingzoo.co', + 'pony.social', + 'vulpine.club', + 'yiff.life', + 'socel.net', + 'octodon.social', + 'filly.social', + 'pone.social', + 'hooves.social', + 'baraag.net', + 'furries.club', + ], + ], + [ + 'palette', + ['ych.art', 'commishes.com'] + ], + [ + ['patreon', brandsSubtype], + 'patreon.com' + ], + [ + 'paw', + ['furaffinity.net', 'e621.net', 'furbooru.org', 'inkbunny.net', 'e926.net', 'sofurry.com', 'weasyl.co'], + ], + [ + ['pixiv', brandsSubtype], + ['pixiv.net', 'pixiv.me'], + ], + [ + ['reddit', brandsSubtype], + ['reddit.com', 'redd.it'], + ], + // Patreon piracy website, applying custom icon to easily catch such posts. + [ + 'skull-crossbones', + 'kemono.cr', + ], + [ + ['telegram', brandsSubtype], + 't.me', + ], + [ + ['tiktok', brandsSubtype], + 'tiktok.com' + ], + [ + ['tumblr', brandsSubtype], + ['tumblr.com', 'tmblr.co', 'tumbex.com'], + ], + [ + ['vk', brandsSubtype], + ['vk.com', 'vk.ru'], + ], + [ + ['x-twitter', brandsSubtype], + ['x.com', 'twitter.com', 'twimg.com'] + ], + [ + ['youtube', brandsSubtype], + ['youtube.com', 'youtu.be'], + ], ]); }