Created
February 20, 2021 02:13
-
-
Save michaelrhodes/ba7b4eb6dbcbad91585d9c3c1f32fae9 to your computer and use it in GitHub Desktop.
Remove tracking parameters from anchor tags
This file contains 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
javascript:!function(d){[].forEach.call(d.querySelectorAll('a'),a=>{a.setAttribute('rel','noreferrer%20noopener');(a.href=a.href.split('?').map((v,i)=>i?v.replace(/&?(ref|utm_[^=]+)=[^&]*(&|$)/g,''):v).join('?').replace(/\?$/,''))})}(document) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment