Prefer higher resolution link preview images

See [#5000][0].

[0]: https://github.com/signalapp/Signal-Desktop/pull/5000
This commit is contained in:
Sasha Chedygov 2021-04-02 13:32:45 -07:00 committed by GitHub
parent ea7a5449f1
commit e8fb835857
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 1 deletions

View file

@ -354,9 +354,10 @@ const parseMetadata = (
const rawImageHref =
getOpenGraphContent(document, ['og:image', 'og:image:url']) ||
getLinkHrefAttribute(document, [
'apple-touch-icon',
'apple-touch-icon-precomposed',
'shortcut icon',
'icon',
'apple-touch-icon',
]);
const imageUrl = rawImageHref ? maybeParseUrl(rawImageHref, href) : null;
const imageHref = imageUrl ? imageUrl.href : null;