Strip awstrack.me tracking

This commit is contained in:
the-djmaze 2022-04-05 11:43:44 +02:00
parent 873c9ebd8c
commit ff394356b6

View file

@ -15,8 +15,11 @@ const
replaceWithChildren = node => node.replaceWith(...[...node.childNodes]),
// Strip utm_* tracking
stripTracking = text => text.replace(/([?&])utm_[a-z]+=[^&?#]*/gsi, '$1').replace(/&&+/, '');
// Strip tracking
stripTracking = text => text
.replace(/^.+awstrack\.me\/.+(https:%2F%2F[^/]+)/gsi, (...m) => decodeURIComponent(m[1]))
.replace(/([?&])utm_[a-z]+=[^&?#]*/gsi, '$1')
.replace(/&&+/, '');
export const