mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Resolve #1225 by using optional link tracking
This commit is contained in:
parent
d2c59d2e1c
commit
d55ce60cc5
42 changed files with 153 additions and 46 deletions
|
|
@ -109,7 +109,8 @@ export class MailMessageView extends AbstractViewRight {
|
|||
actionsMenu: null,
|
||||
// viewer
|
||||
viewFromShort: '',
|
||||
dkimData: ['none', '', '']
|
||||
dkimData: ['none', '', ''],
|
||||
nowTracking: false
|
||||
});
|
||||
|
||||
this.moveAction = moveAction;
|
||||
|
|
@ -208,6 +209,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
// TODO: make first param a user setting #683
|
||||
this.viewFromShort(message.from.toString(false, true));
|
||||
this.dkimData(message.dkim[0] || ['none', '', '']);
|
||||
this.nowTracking(false);
|
||||
} else {
|
||||
MessagelistUserStore.selectedMessage(null);
|
||||
|
||||
|
|
@ -500,6 +502,17 @@ export class MailMessageView extends AbstractViewRight {
|
|||
currentMessage().showExternalImages();
|
||||
}
|
||||
|
||||
showTracking() {
|
||||
const msg = currentMessage(), body = msg?.body;
|
||||
if (body && msg.hasTracking()) {
|
||||
let attr = 'data-x-href-tracking';
|
||||
body.querySelectorAll('a['+attr+']').forEach(node => node.href = node.getAttribute(attr));
|
||||
// attr = 'data-x-src-tracking';
|
||||
// body.querySelectorAll('img['+attr+']').forEach(node => node.src = node.getAttribute(attr));
|
||||
this.nowTracking(true);
|
||||
}
|
||||
}
|
||||
|
||||
whitelistText(txt) {
|
||||
let value = (SettingsUserStore.viewImagesWhitelist().trim() + '\n' + txt).trim();
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue