mattjuffs / framework

An HTML5, CSS3, jQuery framework all on the one page
https://slickhouse.com/framework
MIT License
2 stars 1 forks source link

Email Obfuscation #1

Open mattjuffs opened 10 years ago

mattjuffs commented 10 years ago

Replace the plaintext email with an obfuscated one: http://snippets.slickhouse.com/javascript/105/write-out-email-address/

AaronLayton commented 10 years ago

That's probably not going to work. If I came along and searched the DOM then you could find any email address with that method with just this

$('a[href^="mailto:"]')
mattjuffs commented 10 years ago

Bugger, there's no way around them is there then? I could resort to an image, but it's not very user friendly.

AaronLayton commented 10 years ago

Yeah there are still a few ways around, just need to be clever about it.. I would create an MVC helper and Route that worked together

https://gist.github.com/AaronLayton/9351598

It is a Gist so you can update that the same as you would a normal repo (I think)

mattjuffs commented 10 years ago

Ah, I see what you're doing there - it might be possible to just setup a redirect in the web.config then, if running on IIS.

AaronLayton commented 10 years ago

Would the redirect be able to replace certain characters?

mattjuffs commented 10 years ago

Not sure, but you could simply have href="/contact/email" in the HTML and then a 301 redirect to the mailto link - but chances are the spiders/bots would be able to crawl the /contact/email link.

AaronLayton commented 10 years ago

Ah I see what you mean, web.config would work for a singular then..

I think normal bots (Google) would follow the redirect and then not cache the mail to?

AaronLayton commented 10 years ago

Could also just add a robots dissallow for the URL folder

mattjuffs commented 10 years ago

I'll try the web.config method - it's got to be better than plaintext.