Improve image detection (#2472)

* Mark every non-https link as 'not image'

* Mark xcancel.com links as 'not image'
This commit is contained in:
ekzyis 2025-08-30 02:50:12 +02:00 committed by GitHub
parent 5898f09b34
commit a95da3d108
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,9 +31,9 @@ const imageUrlMatchers = [
u => u.host === 'i.imgur.com'
]
const exclude = [
u => u.protocol === 'mailto:',
u => u.protocol !== 'https:',
u => u.host.endsWith('.onion') || u.host.endsWith('.b32.ip') || u.host.endsWith('.loki'),
u => ['twitter.com', 'x.com', 'nitter.it', 'nitter.at'].some(h => h === u.host),
u => ['twitter.com', 'x.com', 'nitter.it', 'nitter.at', 'xcancel.com'].some(h => h === u.host),
u => u.host === 'stacker.news',
u => u.host === 'news.ycombinator.com',
u => u.host === 'www.youtube.com' || u.host === 'youtu.be',