隐藏电子邮件地址from Bots - 保持mailto: [英] Hide Email Address from Bots - Keep mailto:

查看:94
本文介绍了隐藏电子邮件地址from Bots - 保持mailto:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tl; dr



在不使用脚本和维护 mailto:功能的情况下,从bots中隐藏电子邮件地址。方法还必须支持屏幕阅读器。






摘要




  • 使用脚本或联系表单电子邮件模糊处理


  • 电子邮件地址必须完全可见,并且维护 mailto:功能

  • 电子邮件地址不得为图片形式


  • 电子邮件地址必须对垃圾邮件抓取工具和垃圾邮件机器人 / strong>







所需效果:




  • 无脚本。没有在项目中使用的脚本和我想保持这样


  • 电子邮件地址显示在页面,或者可以在某种用户互动(例如打开模态)后轻松显示。


  • 用户可以点击电子邮件地址,这会触发 mailto: code>功能。


  • 点击电子邮件将打开用户的电子邮件应用程序。



    换句话说, mailto:功能必须有效。

    / li>
  • 电子邮件地址不可见或无法识别为电子邮件地址(包括网页来源)


  • 我没有充满垃圾邮件的收件箱。






$ b

工作

什么


  • 添加联系表单 - 或任何类似 - 而不是电子邮件地址



    我讨厌联系表单。我很少填写联系表格。如果没有电子邮件地址,我会寻找一个电话号码,如果没有,我开始寻找替代服务。


  • 使用地址图片替换地址



    这会对使用屏幕阅读器的人造成巨大劣势(请记住您未来的项目中的视障者



    它还删除 mailto:功能,除非您使图像可点击,然后添加 mailto:功能作为链接的 href ,但无效的目的,现在的电子邮件







可能有效:








类似问题/修正





(这是Joe Maller建议的一个很好的解决方案,它很好用,但



 < SCRIPT TYPE = javascript> emailE ='emailserver.com'emailE =('yourname'+'@'+ emailE)document.write('< A href =mailto:'+ emailE +'>'+ emailE +' < / a>')< / script>< NOSCRIPT> JavaScript保护的电子邮件地址< / NOSCRIPT>  




  • 寻找只有php的电子邮件地址obfuscator函数



    (一个聪明的解决方案使用 PHP CSS 以首先反向使用PHP的电子邮件,然后使用CSS反向非常有前途的解决方案,工作伟大!但是太容易解决


  • 这些天是否值得在网络上混淆电子邮件地址?



    (Javascript修复)

    >
  • 在网站上模糊电子邮件地址的最佳方式?



    所选答案有效。它实际上工作非常好。它包括将电子邮件编码为 html实体



     < A HREF =mailto:&#121;&#111;&#117;&#114;&#110;&#097& ;#109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046; ;#099;&#111;&#109;&#121;&#111;&#117;&#114;&#110;&#097& 109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046; 099;&#111;&#109;< / A>  

    b
  • 电子邮件地址混淆实际上是否工作?



    (这个超级用户问题的选择答案是很好的,它介绍了通过使用不同的混淆方法收到的垃圾邮件量的研究。



    似乎是用 CSS 操作电子邮件地址,使它 rtl 。这是我在本节中链接的第一个问题中使用的相同方法。



    我不确定添加 mailto:功能对修复结果会有什么影响。


  • SO ,它们都有类似的答案。我还没有找到符合我想要的效果的东西







问题:



有可能提高电子邮件混淆的效率方法结合两个或更多修复(或甚至添加新修复)



A-维护 mailto:功能;





$ b

编辑



下面的许多答案和评论好的问题,同时指出不可能这样做没有某种 js




为什么不使用 js ? >

答案是我对 js



虽然开玩笑,



我问这个问题的三个主要原因是:




  • 联系表格越来越被接受作为替代品
    用于提供电子邮件地址 - 他们不应该这样做。


  • 如果可以没有脚本,则应该而不使用
    脚本。


  • 好奇心:(因为我实际上正在使用 js 修复)我想看到 if



解决方案

您的请求的问题具体是支持屏幕阅读器,按定义屏幕阅读器是某种bot。如果屏幕阅读器能够解释电子邮件地址,那么页面抓取工具也能够解释它。



此外,mailto的点属性将是如何在网络上执行电子邮件地址的标准。询问是否有第二种方法是询问是否有第二个标准。



通过脚本执行它仍然会有一样的问题,一旦页面被加载,脚本将被运行,并且在DOM中呈现的电子邮件地址(除非您在点击或某事上填充电子邮件地址)。无论如何,屏幕阅读器仍然会有问题,因为它还没有加载。



老实说,只是得到一个电子邮件服务与一个体面的垃圾过滤器,并指定一个默认主题

 < a href =mailto:no-one @ no- where.com?subject=Something要过滤>向我发送电子邮件< / a> 

你要求的是,如果标准有两种方法来做某事,一种用于机器人和其他的非机器人。答案是,它不是,你必须尽可能最好地打架机器人。


tl;dr

Hide email address from bots without using scripts and maintain mailto: functionality. Method must also support screen-readers.


Summary

  • Email obfuscation without using scripts or contact forms

  • Email address needs to be completely visible to human viewers and maintain mailto: functionality

  • Email Address must not be in image form.

  • Email address must be "completely" hidden from spam-crawlers and spam-bots and any other harvester type


Desired Effect:

  • No scripts, please. There are no scripts used in the project and I'd like to keep it that way.

  • Email address is either displayed on the page or can be easily displayed after some sort of user interaction, like opening a modal.

  • The user can click on on the email address which in turn would trigger the mailto: functionality.

  • Clicking the email will open the user's email application.

    In other words, mailto: functionality must work.

  • The email address in not visible or not identified as an email address to bots (This includes the page source)

  • I don't have an inbox that's full of spam


What does NOT Work

  • Adding a contact form - or anything similar - instead of the email address

    I hate contact forms. I rarely fill up a contact form. If there's no email address, I look for a phone number, and if that's not there, I start looking for an alternative service. I would only fill up a contact form if I absolutely have to.

  • Replacing the address with an image of the address

    This creates a HUGE disadvantage to someone using a screenreader (please remember the visually impaired in your future projects)

    It also removes the mailto: functionality unless you make the image clickable and then add the mailto: functionality as the href for the link, but that defeats the purpose and now the email is visible to bots.


What might work:

  • Clever usage of pseudo-elements in CSS

  • Solutions that make use of base64 encoding

  • Breaking up the email address and spreading the parts across the document then putting them back together in a modal when the user clicks a button (This will probably involve multiple CSS classes and the usage of anchor tags)

  • Alterting html attributes via CSS

    @MortezaAsadi gracefully brought up the possibility in the comments below. This is the link to the full - The article is from 2012:

    What if We Could Use CSS to Alter HTML Attributes?

  • Other creative solutions that are beyond my scope of knowledge.


Similar Questions / Fixes

(This a great fix suggested by Joe Maller, it works well but it's script based. Here's what it looks like;

<SCRIPT TYPE="text/javascript">

  emailE = 'emailserver.com'

  emailE = ('yourname' + '@' + emailE)

  document.write('<A href="mailto:' + emailE + '">' + emailE + '</a>')

</script>



<NOSCRIPT>

  Email address protected by JavaScript

</NOSCRIPT>

  • Looking for a php only email address obfuscator function

    (A Clever solution using both PHP and CSS to first reverse the email using PHP then reverse it back with CSS) A very promising solution that Works great! But it's too easy to solve.

  • Is it worth obfuscating email addresses on the web these days?

    (Javascript fix)

  • Best way to obfuscate an e-mail address on a website?

    The selected answer works. It actually works really well. It involves encoding the email as html entities. Can it be improved?

    Here's what it looks like;

    <A HREF="mailto:
    
    &#121;&#111;&#117;&#114;&#110;&#097;&#109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109;">
    
    &#121;&#111;&#117;&#114;&#110;&#097;&#109;&#101;&#064;&#100;&#111;&#109;&#097;&#105;&#110;&#046;&#099;&#111;&#109;
    
    </A>

  • Does e-mail address obfuscation actually work?

    (The selected answer to this SuperUser question is great and it presents a study of the amount of spam received by using different obfuscation methods.

    It seems that manipulating the email address with CSS to make it rtl does work. This is the same method used in the first question I linked to in this section.

    I am uncertain what effects adding mailto: functionality to the fix would have on the results.

  • There are also many other questions on SO which all have similar answers. I have not found anything that fits my desired effect


The Question:

Would it be possible to increase the efficiency (ie as little spam as possible) of the email obfuscation methods above by combining two or more of the fixes (or even adding new fixes) while:

A- Maintaining mailto: functionality; and

B- Supporting screen-readers


Edit:

Many of the answers and comments below pose a very good question while indicating the impossibility of doing this without some sort of js

The question that's asked/implied is:

Why not use js?

The answer is that I am allergic to js

Joking aside though,

The three main reasons I asked this question are:

  • Contact forms are becoming more and more accepted as a replacement for providing an email address - which they should not.

  • If it can be done without scripting then it should be done without scripting.

  • Curiosity: (as I am in fact using one of the js fixes currently) I wanted to see if discussing the matter would lead to a better way of doing it.

解决方案

The issue with your request is specifically the "Supporting screen-readers" as by definition screen readers are a "bot" of some sort. If a screen-reader to be able to interpret the email address, then a page-crawler would be able to interpret it as well.

Also, the point of the mailto attribute is to be the standard of how to do email addresses on the web. Asking if there is a second way to do that is sort of asking if there is a second standard.

Doing it through scripts will still have the same issue as once the page is loaded, the script would have been run and the email address rendered in the DOM (unless you populate the email address on click or something). Either way, screen readers will still have issues with this since it's not already loaded.

Honestly, just get an email service with a half decent spam filter and specify a default subject line that is easy for you to sort in your inbox.

<a href="mailto:no-one@no-where.com?subject=Something to filter on">Email me</a>

What you're asking for is if the standard has two ways to do something, one for bots and the other for non-bots. The answer is it doesn't and you have to just fight the bots as best you can.

这篇关于隐藏电子邮件地址from Bots - 保持mailto:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆