禁用的用户名和密码的Safari自动填写 [英] Disabling Safari autofill on usernames and passwords

查看:1118
本文介绍了禁用的用户名和密码的Safari自动填写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可能已经知道,Safari浏览器有一个讨厌的自动填充的错误,如果你设置自动完成=关闭或不到哪它填补电子邮件,用户名和密码字段不管。

You might already know, that Safari has a nasty autofill bug where it fills email, username and password fields no matter if you set autocomplete="off" or not.

下面是一个基本形式:

<form action="/" method="post">
    <p>
        <label>E-mail</label>
        <input type="text" name="email" value="" />
    </p>
    <p>
        <label>Password</label>
        <input type="password" name="password" value="" />
    </p>
</form>

... Safari浏览器自动填充在页面加载这些领域像它应该,出色地完成工作!

...Safari autofills those fields on page load like it should, job well done!

如果你把自动完成=关闭来的字段和/或表单元素,Safari浏览器仍然自动填充这些字段:

If you put autocomplete="off" to the fields and/or the form element, Safari still autofills those fields:

<form action="/" method="post" autocomplete="off">
    <p>
        <label>E-mail</label>
        <input type="text" name="email" value="" autocomplete="off" />
    </p>
    <p>
        <label>Password</label>
        <input type="password" name="password" value="" autocomplete="off" />
    </p>
</form>

即使这不工作:

<form action="/" method="post" autocomplete="off">
    <p>
        <label>E-mail</label>
        <input type="text" name="secretfield1" value="" autocomplete="off"/>
    </p>
    <p>
        <label>Password</label>
        <input type="password" name="secretfield2" value="" autocomplete="off" />
    </p>
</form>

...因为Safari浏览器查找那些&LT;标签&gt; 如果包含的话电子邮件,密码等,并与自动填充向前走元素

...since Safari looks up those <label> elements if they contain words "E-mail", "Password" etc. and goes ahead with the autofill.

Aaaahhhhha!我想,试着这:

Aaaahhhhha!, I thought, and tried this:

<form action="/" method="post" autocomplete="off">
    <p>
        <label>%REPLACE_EMAIL_TITLE%</label>
        <input type="text" name="%REPLACE_EMAIL_NAME%" value="" autocomplete="off"/>
    </p>
    <p>
        <label>%REPLACE_PASSWORD_TITLE%</label>
        <input type="password" name="%REPLACE_PASSWORD_NAME%" value="" autocomplete="off" />
    </p>
</form>

...和使用JavaScript的真实姓名替换%TAGS%。英寸无论Safari浏览器自动填充踢,如果你在更换设置10秒超时。

...and replace %TAGS% with the real names using JavaScript. Safari autofill kicks in. No matter if you set a 10 second timeout on the replacement.

所以,这真的是唯一的选择?

So, is this really the only option?

<form action="/" method="post" autocomplete="off">
    <p>
        <label>That electronic postal address we all use, but can't write the title here because Safari fills this with YOUR information if you have autofill turned on</label>
        <input type="text" name="someelectronicpostaladdress" value="" autocomplete="off"/>
    </p>
    <p>
        <label>A set of characters, letters, numbers and special characters that is so secret that only you or the user you are changing it for knows, but can't write the title here because Safari sucks</label>
        <input type="password" name="setofseeecretcharacters" value="" autocomplete="off" />
    </p>
</form>

我希望不是?

更新: @skithund在微博指出的,<一个href=\"http://www.mactrast.com/2014/03/apple-seeds-$p$p-release-safari-7-0-3-safari-6-1-3-seed-2-developers/\">Safari正在获取4.0.3更新,其中提到登录自动填充。有谁知道,如果该更新将会解决这一问题?

UPDATE: @skithund pointed out in Twitter, that Safari is getting a 4.0.3 update, which mentions "Login AutoFill". Does anyone know if that update is going to fix this?

推荐答案

我有同样的问题。虽然我的解决方案并不完美,它似乎工作。基本上,Safari浏览器似乎寻找与用户名和密码输入栏,并总是试图填补它。所以,我的解决方案是目前的其中一个Safari浏览器可以填补前添加一个假的用户名和密码字段。我试着用风格=显示:无;,但没有奏效。所以,最终,我只是用风格=的位置是:绝对的;顶部:-50px;这个隐藏输入字段淡出人们的视线,似乎很好地工作。我不想使用JavaScript,但我想你可以通过JavaScript将其隐藏。

I had the same problem. And though my solution is not perfect, it seems to work. Basically, Safari seems to look for an input field with password and username and always tries to fill it. So, my solution was to add a fake username and password field before the current one which Safari could fill. I tried using style="display: none;" but that did not work. So, eventually, I just used style="position:absolute; top:-50px;" and this hid the input field out of sight and seemed to work fine. I did not want to use JavaScript but I guess you could hide it with JavaScript.

现在的Safari从来没有自动完成我的用户名和密码字段。

Now Safari never autocompleted my username and password fields.

这篇关于禁用的用户名和密码的Safari自动填写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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