mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-01 04:22:15 +08:00
Strip Reddit click tracking
This commit is contained in:
parent
7b6603719e
commit
1f600dff0d
1 changed files with 2 additions and 2 deletions
|
@ -31,13 +31,13 @@ const
|
|||
* https://github.com/M66B/FairEmail/blob/master/app/src/main/java/eu/faircode/email/UriHelper.java
|
||||
*/
|
||||
// eslint-disable-next-line max-len
|
||||
stripParams = /^(utm_|ec_|fbclid|mc_eid|mkt_tok|_hsenc|vero_id|oly_enc_id|oly_anon_id|__s|Referrer|mailing|elq|bch|trc)/i,
|
||||
stripParams = /^(utm_|ec_|fbclid|mc_eid|mkt_tok|_hsenc|vero_id|oly_enc_id|oly_anon_id|__s|Referrer|mailing|elq|bch|trc|ref)/i,
|
||||
urlGetParam = (url, name) => new URL(url).searchParams.get(name) || url,
|
||||
base64Url = data => atob(data.replace(/_/g,'/').replace(/-/g,'+')),
|
||||
stripTracking = url => {
|
||||
url = url
|
||||
.replace(/tracking\.(printabout\.nl[^?]+)\?.*/i, (...m) => m[1])
|
||||
.replace(/^.+awstrack\.me\/.+(https:%2F%2F[^/]+)/i, (...m) => decodeURIComponent(m[1]))
|
||||
.replace(/^.+(awstrack\.me|redditmail\.com)\/.+(https:%2F%2F[^/]+).*/i, (...m) => decodeURIComponent(m[2]))
|
||||
.replace(/^.+(www\.google|safelinks\.protection\.outlook\.com).+$/i, () => urlGetParam(url, 'url'))
|
||||
.replace(/^.+delivery-status\.com.+$/i, () => urlGetParam(url, 'fb'))
|
||||
.replace(/^.+go\.dhlparcel\.nl.+\/([^/]+)$/i, (...m) => base64Url(m[1]))
|
||||
|
|
Loading…
Reference in a new issue