以编程方式禁用 Firefox 中的密码确认弹出窗口

Programmatically disable password confirmation pop-up in Firefox

我有一个简单的密码更改表单,如下所示。它是较大页面的一部分,但此片段用于说明。此表单中没有用户标识符 - 没有登录名、ID 或其他参考。这不是必需的,因为该信息作为会话数据的一部分存储在服务器上,并在通过 AJAX 调用提交此表单时在服务器上获取。

<div id="passwordChange" >
    <form id="passwordForm">
        <table class="formbox dropshadow">
            <thead>
            <tr>
                <td colspan="2">Change Password</td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td><label for="currentPassword">Current Password</label></td>
                <td><input id="currentPassword" name="oldPassword" type="password" required pattern=".{5,20}" title="Passwords should be between 5 and 20 characters long"></td>
            </tr>
            <tr>
                <td><label for="newPassword">New Password</label></td>
                <td><input id="newPassword" name="newPassword" type="password" required pattern=".{5,20}" title="Passwords should be between 5 and 20 characters long"></td>
            </tr>
            <tr>
                <td><label for="confirmPassword">Confirm Password</label></td>
                <td><input id="confirmPassword" name="confirmPassword" type="password" required pattern=".{5,20}" title="Passwords should be between 5 and 20 characters long"></td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan=2>
                    <input type="hidden" name="cmd" value="setPassword">
                    <input type=submit name=submit value="Change Password">
                    <input type=button name=cancel value="Cancel">
                </td>
            </tr>

            </tfoot>
        </table>
    </form>
</div>

如果我在第一个密码框中输入 Firefox 已经为域存储的密码,并且 Firefox 已经为多个存储的用户存储了该密码,当我单击 Change Password:

问题是,我可能不会更改任何列出的用户的密码,但如果不给 Firefox 一个答案我就无法继续进行下去。这使得无法更改其密码未被 Firefox 密码管理器存储的用户的密码。

现在,可能有一个配置选项可以启用或禁用此行为(我很乐意听到它),但这只对我的计算机有用。

我希望能够在页面中禁用此行为,这样我的客户就不会 运行 反对它。

有没有我可以使用的 HTML 标签或属性?是否有 Javascript hack,或者我可以对表单进行结构性更改以阻止这种情况发生?

FWIW 我正在 运行ning Firefox 37.0.2

没有 HTML 标签或属性可以实现这一点。 这是特定于浏览器的,而不是网页操作。

在解决这个问题一段时间后,我尝试将 autocomplete="off" 属性添加到我的表单中。有了这个 <input>,你瞧,没有密码管理器的干扰:

<input autocomplete="off" id="currentPassword" name="oldPassword" type="password" required pattern=".{5,20}" title="Passwords should be between 5 and 20 characters long">

现在,这与 Daniel A. White 提到的错误报告(见上文)和 this 等网页上的注释背道而驰,这两者都表明可以关闭autocomplete 正在从浏览器中删除。也许是,但它似乎不适用于这里,这就是我所关心的。

(关于浏览器制造商是否应该单方面凌驾于网站设计者的意愿之上的单独争论是另一个时间和地点的争论)。

脚注: 在摆弄这个的同时我做了一些应该很明显但不直观的事情:我点击了红色 X 并关闭了 window。密码管理器没有更新任何东西就消失了,一切都如我所愿。我仍然觉得 'None of the Above' 按钮,或 'Not Now' 或其他更友好的按钮。