Last active
January 19, 2026 11:28
-
-
Save adamotte/0cfdd93ac58f45991171614c80346e72 to your computer and use it in GitHub Desktop.
Dealabs Digidip Global Safe Cleaner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Dealabs Digidip Global Safe Cleaner (DEBUG) | |
| // @namespace https://tampermonkey.net/ | |
| // @version 0.2 | |
| // @description Nettoyage global et sûr des liens Dealabs/Digidip (anti-tracking, non destructif) | |
| // @match https://dealabs.digidip.net/visit* | |
| // @run-at document-start | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| console.log('[DD Cleaner] Script chargé'); | |
| console.log('[DD Cleaner] URL courante :', window.location.href); | |
| const params = new URLSearchParams(window.location.search); | |
| const encodedUrl = params.get('url'); | |
| if (!encodedUrl) { | |
| console.warn('[DD Cleaner] Paramètre url= introuvable'); | |
| return; | |
| } | |
| console.log('[DD Cleaner] URL encodée :', encodedUrl); | |
| let targetUrl; | |
| try { | |
| targetUrl = new URL(decodeURIComponent(encodedUrl)); | |
| console.log('[DD Cleaner] URL décodée :', targetUrl.toString()); | |
| } catch (e) { | |
| console.error('[DD Cleaner] Erreur décodage URL', e); | |
| return; | |
| } | |
| const before = targetUrl.toString(); | |
| /** LISTES DE FILTRAGE **/ | |
| const TRACKING_PREFIXES = [ | |
| 'utm_', 'pf_rd_', 'pk_', 'mtm_', 'vero_' | |
| ]; | |
| const TRACKING_KEYS = [ | |
| 'tag', 'ref', 'ref_', 'source', 'medium', 'campaign', | |
| 'awc', 'gclid', 'fbclid', 'yclid', 'msclkid', | |
| 'aff', 'affid', 'affiliate', 'partner', 'irclickid', | |
| 'sc_channel', 'sc_campaign', 'sc_medium' | |
| ]; | |
| const TRACKING_KEYWORDS = [ | |
| 'aff', 'track', 'promo', 'click', 'banner', 'ad' | |
| ]; | |
| /** LOGIQUE DE NETTOYAGE **/ | |
| [...targetUrl.searchParams.keys()].forEach(key => { | |
| const keyLower = key.toLowerCase(); | |
| const isTracking = | |
| TRACKING_PREFIXES.some(p => keyLower.startsWith(p)) || | |
| TRACKING_KEYS.includes(keyLower) || | |
| TRACKING_KEYWORDS.some(k => keyLower.includes(k)); | |
| if (isTracking) { | |
| console.log(`[DD Cleaner] Suppression paramètre : ${key}`); | |
| targetUrl.searchParams.delete(key); | |
| } | |
| }); | |
| if (before !== targetUrl.toString()) { | |
| console.log('[DD Cleaner] URL nettoyée :', targetUrl.toString()); | |
| } else { | |
| console.log('[DD Cleaner] Aucun paramètre supprimé'); | |
| } | |
| /** FINAL **/ | |
| if ([...targetUrl.searchParams].length === 0) { | |
| targetUrl.search = ''; | |
| console.log('[DD Cleaner] Query string supprimée entièrement'); | |
| } | |
| console.log('[DD Cleaner] Redirection vers :', targetUrl.toString()); | |
| window.location.replace(targetUrl.toString()); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment