This commit is contained in:
the-djmaze 2022-10-21 12:48:33 +02:00
parent cbafa55450
commit bcf63b6700
11 changed files with 40 additions and 36 deletions

View file

@ -291,28 +291,7 @@ export const
if ('IMG' === name) {
oElement.loading = 'lazy';
let attachment;
if (detectHiddenImages
&& ((oStyle.maxHeight && 3 > pInt(oStyle.maxHeight))
|| (oStyle.maxWidth && 3 > pInt(oStyle.maxWidth))
|| [
'email.microsoftemail.com/open',
'github.com/notifications/beacon/',
'/track/open', // mandrillapp.com list-manage.com
'google-analytics.com'
].filter(uri => value.toLowerCase().includes(uri)).length
)) {
skipStyle = true;
setAttribute('style', 'display:none');
setAttribute('data-x-src-hidden', value);
}
else if ((attachment = findLocationByCid(value)))
{
if (attachment.download) {
oElement.src = attachment.linkPreview();
attachment.isLinked(true);
}
}
else if ('cid:' === value.slice(0, 4))
if ('cid:' === value.slice(0, 4))
{
value = value.slice(4);
setAttribute('data-x-src-cid', value);
@ -324,6 +303,28 @@ export const
attachment.isLinked(true);
}
}
else if ((attachment = findLocationByCid(value)))
{
if (attachment.download) {
oElement.src = attachment.linkPreview();
attachment.isLinked(true);
}
}
else if (detectHiddenImages
&& ((oStyle.maxHeight && 3 > pInt(oStyle.maxHeight)) // TODO: issue with 'in'
|| (oStyle.maxWidth && 3 > pInt(oStyle.maxWidth)) // TODO: issue with 'in'
|| [
'email.microsoftemail.com/open',
'github.com/notifications/beacon/',
'/track/open', // mandrillapp.com list-manage.com
'google-analytics.com'
].filter(uri => value.toLowerCase().includes(uri)).length
)) {
skipStyle = true;
oStyle.display = 'none';
// setAttribute('style', 'display:none');
setAttribute('data-x-src-hidden', value);
}
else if (httpre.test(value))
{
setAttribute('data-x-src', value);

View file

@ -400,6 +400,7 @@ html.rl-no-preview-pane {
img[data-x-src]:not([src])::after {
content: "🖼";
font-family: snappymail;
line-height: 1;
position: absolute;
top: 0;
left: 0;
@ -411,7 +412,6 @@ html.rl-no-preview-pane {
font-family: var(--fontSans);
font-size: 11px;
height: auto;
line-height: 1;
transform: translate(-25%,0);
width: auto;
width: -moz-fit-content;