Created
December 17, 2019 19:36
-
-
Save tripflex/d6b995a4141b3e56f6b530cf08ca4aac to your computer and use it in GitHub Desktop.
Hide/Obfuscate/Mask Email Address from Spam Bots (Vue.js Component)
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
<template> | |
<span class="reverse">{{reversedEmail}}</span> | |
</template> | |
<script> | |
export default { | |
name: 'hide-email', | |
props: [ 'email' ], | |
computed: { | |
reversedEmail(){ | |
return this.email.split("").reverse().join("") | |
} | |
} | |
} | |
</script> | |
<style scoped> | |
span.reverse { | |
unicode-bidi: bidi-override; | |
direction: rtl; | |
} | |
</style> |
but it doesn't work with cmd c (mac) or control C (windows)
Most of the user just copy e-mail like that, and never click it, to open the default e-mail app in computer.
Most of users prefer to use gmail or hotmail site instead
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basically the way this works is by using CSS to reverse the text (so it displays correctly), but to spam bots or harvesters, when looking at the source code they will see the email in reverse.
Based off suggestion here:
https://stackoverflow.com/questions/483212/effective-method-to-hide-email-from-spam-bots