forked from FoundKeyGang/FoundKey
client: remove some more tracking
This commit is contained in:
parent
a6c5e9f358
commit
f4e234d108
1 changed files with 8 additions and 0 deletions
|
@ -1,4 +1,8 @@
|
|||
import { deviceKind } from '@/scripts/device-kind';
|
||||
|
||||
export function removeTracking(url: string): string {
|
||||
const isMobile = deviceKind !== 'desktop';
|
||||
|
||||
let parsed;
|
||||
try {
|
||||
parsed = new URL(url);
|
||||
|
@ -11,6 +15,10 @@ export function removeTracking(url: string): string {
|
|||
parsed.searchParams.delete('si'); // source identifier
|
||||
} else if (['heise.de', 'www.heise.de'].includes(parsed.host)) {
|
||||
parsed.searchParams.delete('wt_mc');
|
||||
} else if (['derstandard.at', 'www.derstandard.at'].includes(parsed.host)) {
|
||||
parsed.searchParams.delete('ref');
|
||||
} else if (!isMobile && /\.m\.wikipedia\.org$/i.test(parsed.host)) {
|
||||
parsed.host = parsed.host.replace('.m.', '.');
|
||||
} else {
|
||||
parsed.searchParams.delete('utm_source');
|
||||
parsed.searchParams.delete('utm_medium');
|
||||
|
|
Loading…
Reference in a new issue