I've seen this email protection on a website and would like to know how they have achieved this [duplicate]

孤人 提交于 2020-01-03 20:56:11

问题


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&#160;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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!