GWT 和自动填充
我注意到浏览器不会将我的密码字段识别为潜在的自动完成目标。我假设这与密码字段不在原始 HTML 中有关 - 它是在页面加载后由我的 GWT 脚本创建的。
有没有办法告诉浏览器,“嘿,这是这个表单,像往常一样对待它吗?”如何让浏览器连接到我的应用程序以进行自动填充?
I've noticed that browsers don't recognize my password field as a potential auto-complete target. I'm assuming this has something to do with the fact that the password field isn't in the original HTML - it's created by my GWT script after the page has loaded.
Is there a way to tell a browser, "hey, here's this form, treat it like usual?" How can I let browsers hook into my app for autofill?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一些解决方法可以让浏览器自动完成您的登录,如此处。
经过一段时间的努力后,我强烈建议您简单地包装主机页面的现有表单(不要使用 GWT 生成输入),在其上执行
form.submit()
并让 servlet 监听到请求。There are some workarounds to get the browser to auto-complete your login like the one described here.
After struggling some time with it I strongly suggest you simply wrap an existing form of your host page (do not generate the inputs with GWT), do a
form.submit()
on it and have a servlet listen to the request.我相信出于相当明显的安全原因,密码字段(带有 type="password" 的标签)不会自动填充。该字段在页面加载后由 GWT 脚本添加并不重要。
尝试模仿常规 HTML 中的字段,并将其与 GWT 应用程序创建 DOM 结构的方式进行比较。也许您的 GWT 应用程序以不同的方式将页面组合在一起?
I believe that password fields ( tags with type="password") are not auto-filled for fairly obvious security reasons. It doesn't matter that the field is added after page load by your GWT script.
Try mimicking the field in regular HTML and compare that to how your GWT app creates the DOM structure. Perhaps your GWT app is putting the page together differently?