nsIPasswordManager 编辑

netwerk/base/public/nsIPasswordManager.idlScriptable Used to interface with the built-in Password Manager 66 Introduced Gecko 1.0 Deprecated Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.0

See Using nsIPasswordManager for examples.

Implemented by: @mozilla.org/passwordmanager;1. To create an instance, use:

var passwordManager = Components.classes["@mozilla.org/passwordmanager;1"]
                                .getService(Components.interfaces.nsIPasswordManager);

Method overview

void addUser(in AUTF8String aHost, in AString aUser, in AString aPassword);
void removeUser(in AUTF8String aHost, in AString aUser);
void addReject(in AUTF8String aHost);
void removeReject(in AUTF8String aHost);

Attributes

AttributeTypeDescription
enumeratornsISimpleEnumeratorReadonly: An enumeration of the stored usernames and passwords as nsIPassword objects.
enumeratornsISimpleEnumeratorReadonly: An enumeration of the rejected sites as nsIPassword objects. Only the host portion of these objects is relevant.

Methods

addUser()

Stores a password.

 AString addUser(in AUTF8String aHost,
                 in AString aUser,
                 in AString aPassword);
Parameters
aHost
The hostname of the password to store.
aUser
The username of the password to store.
aPassword
The password to store.

removeUser()

Removes a stored password.

 void removeUser(in AUTF8String aHost,
                 in AString aUser);
Parameters
aHost
The hostname of the password to remove.
aUser
The username of the password to remove.

addReject()

Blocks a hostname from having its passwords saved.

 void addReject(in AUTF8String aHost);
Parameters
aHost
The name of the hostname for which passwords should no longer be saved.

removeReject()

Unblocks a hostname from having its passwords saved.

 void removeReject(in AUTF8String aHost);
Parameters
aHost
The name of the hostname for which passwords can be saved again.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:80 次

字数:4937

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文