mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
Also decode Mandrill custom tracking domain
This commit is contained in:
parent
23bbd10b9a
commit
73ddc6c4b9
1 changed files with 4 additions and 7 deletions
|
@ -20,15 +20,12 @@ const
|
|||
stripTracking = text => text
|
||||
.replace(/tracking\.(printabout\.nl[^?]+)\?.*/gsi, (...m) => m[1])
|
||||
.replace(/^.+awstrack\.me\/.+(https:%2F%2F[^/]+)/gsi, (...m) => decodeURIComponent(m[1]))
|
||||
.replace(/^.+mandrillapp.com.+\?p=([a-z0-9]+)/gsi, (...m) => {
|
||||
let d = JSON.parse(atob(m[1]));
|
||||
if (d && d.p) {
|
||||
.replace(/^.+\/track\/click\/.+\?p=([a-z0-9_]+)$/gsi, (...m) => {
|
||||
let d = JSON.parse(atob(m[1].replace(/_/g,'/').replace(/-/g,'+')));
|
||||
if (d?.p) {
|
||||
d = JSON.parse(d.p);
|
||||
if (d && d.url) {
|
||||
return d.url;
|
||||
}
|
||||
}
|
||||
return m[0];
|
||||
return d?.url || m[0];
|
||||
})
|
||||
.replace(/([?&])utm_[a-z]+=[^&?#]*/gsi, '$1') // Urchin Tracking Module
|
||||
.replace(/([?&])ec_[a-z]+=[^&?#]*/gsi, '$1') // Sitecore
|
||||
|
|
Loading…
Reference in a new issue