简体   繁体   English

禁用nsILoginManagerPrompter for Firefox扩展

[英]Disable nsILoginManagerPrompter for Firefox extension

I have an extension that uses addon-sdk and an HTML/JavaScript popup form for logging in, and I keep getting this error in the Browser Console when I click 'Log In'. 我有一个扩展程序,该扩展程序使用addon-sdk和HTML / JavaScript弹出表单进行登录,单击“登录”时,在浏览器控制台中始终出现此错误。

[Exception... "'PopupNotifications_show: invalid browser' when calling method: [nsILoginManagerPrompter::promptToSavePassword]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "JS frame :: resource://gre/modules/LoginManagerContent.jsm :: <TOP_LEVEL> :: line 551"  data: no]

The login works after about 3 tries, but it is frustrating for clients to have to enter their info into the form several times. 登录大约需要3次尝试,但登录后仍然有效,但客户端不得不多次将其信息输入到表单中,这令人沮丧。

It is impossible for a user to have their password saved via this kind of form anyway, so I just want to know if there is a way to disable it using the addon-sdk or something similar. 无论如何,用户都不可能通过这种形式保存密码,因此我只想知道是否有一种方法可以使用addon-sdk或类似的方法来禁用它。

Or, should I remove the form and validate via AJAX? 或者,我应该删除表格并通过AJAX进行验证吗?

我通过删除表单并使用AJAX进行验证来解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM