Remove tracking parameter from link

From LemonWiki共筆
Revision as of 20:59, 13 November 2022 by Planetoid (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

To remove tracking parameter from link

Bookmarklet: Remove tracking tokens from URL

javascript:(function(){function removeParameters(parms) {for (let i = 0; i < parms.length; i++) {var my_parameter = parms[i];const pattern = new RegExp(`[\?&]${my_parameter}=[^&]+`, %27gi%27);  history.replaceState && history.replaceState(  null, %27%27, location.pathname +, %27%27).replace(/^&/, %27?%27));}  }var parms = [%27fbclid%27, %27gclid%27, %27gclsrc%27, %27utm_source%27, %27utm_medium%27, %27utm_campaign%27, %27utm_content%27, %27utm_term%27];removeParameters(parms);})();

Test data