Emmbeded Code (Simple)
Benefits:
- You only need this code and nothing else
Disadvantages:
- Not compatible with all Content-Security-Policy headers, which
can block the script from running.
<script>var a=atob("".split("?").reverse().join("")),b=document.createElement("a");b.innerText=a;b.href="mailto:"+a;document.currentScript.replaceWith(b);</script>
Reference Code (More Complex)
Benefits:
- Better compatibility with Content-Security-Policy headers.
- Cleaner code and simpler to update
Disadvantages:
- Need to embed a
this script on
the each page, where it is used.
<obfuscated-email obfuscated=""></obfuscated-email>