Firefox Mobile中type="password"提交圆点而非真实密码问题求助
解决Firefox Mobile提交密码框时发送圆点而非真实密码的问题
针对你遇到的Firefox Mobile 123.0版本中,type="password"输入框提交时发送显示圆点(••••)而非真实密码的问题,可以尝试以下几种解决方案:
方案一:用JavaScript拦截表单提交,手动构造请求
通过监听表单提交事件,手动获取密码框的真实value值,构造正确的请求参数提交,绕过浏览器的异常行为:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> </head> <body> <form id="loginForm" action="/test"> <input id="password" type="password" name="password" placeholder="Password" autocomplete="current-password"> <button type="submit">Submit</button> </form> <script> document.getElementById('loginForm').addEventListener('submit', function(e) { e.preventDefault(); const form = this; const passwordInput = document.getElementById('password'); // 构造包含真实密码的FormData const formData = new FormData(form); formData.set('password', passwordInput.value); // 以GET方式提交(与原表单提交方式一致) const params = new URLSearchParams(formData); window.location.href = `${form.action}?${params.toString()}`; }); </script> </body> </html>
其他排查与修复方向
- 更新Firefox Mobile:该问题可能是123.0版本的特定bug,升级到最新版本后大概率会被修复。
- 调整自动填充属性:尝试移除
autocomplete="current-password"属性,或改为autocomplete="off",部分情况下自动填充机制的异常会导致这种问题。 - 排查浏览器扩展:禁用Firefox Mobile中所有与密码管理、隐私相关的扩展,这类扩展可能干扰密码框的提交逻辑。
- 切换输入法:如果使用第三方输入法,切换到系统默认输入法测试,部分第三方输入法可能在密码框中错误插入显示字符而非真实输入内容。
内容的提问来源于stack exchange,提问作者user23527294
相关产品推荐
相关产品推荐

