Created
March 9, 2019 23:22
-
-
Save martinbowling/5185a51b1a5d1d466f146e80c588ba0c to your computer and use it in GitHub Desktop.
JS To Hide Outbound Links With Base 64
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
<a data-href="RdcDovL1N0YWdpbmc...base64...hhcmRpbmctaGVycmVuLWhlbaQtMTgyMDg3" | |
href="#">Link</a> | |
<script> | |
<!-- | |
var _dlist = document.getElementsByTagName('A'); | |
for(i=0;i<_dlist.length;i++) { | |
var _data = _dlist[i].getAttribute( 'data-href' ); | |
if( _data !== 'null' ) { | |
var _extend = CryptoJS.enc.Base64.parse( _data ); | |
_dlist[i].setAttribute( 'href', _extend.toString( CryptoJS.enc.Latin1 ) ); | |
} | |
} | |
--> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment