问题
I would like to know how I can replicate this sort of email protection and what parts of it actually does what please.
<a href="cdn-cgi/l/email-protection.html#d7a7a5bea1b6b4ae97b0b6a3bfb2a5b4b8b9a3b2b9a3f9b4b8ba"><span class="__cf_email__" data-cfemail="0474766d7265677d446365706c6176676b6a70616a702a676b69">[email protected]</span><script data-cfhash='f9e31' type="text/javascript">/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */</script></a>
回答1:
This is CloudFlare's dynamic email obfuscation. CloudFlare automatically apply the obfuscation to websites that they protect.
If your website is protected by CloudFlare, you can turn the feature on by signing in to the dashboard then Cloudflare.com > ScrapeShield > Email Obfuscation.
来源:https://stackoverflow.com/questions/44418721/ive-seen-this-email-protection-on-a-website-and-would-like-to-know-how-they-hav