-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.js
More file actions
27 lines (25 loc) · 729 Bytes
/
api.js
File metadata and controls
27 lines (25 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const TOPIC = "secure-credential-provision";
this.credentials = class extends ExtensionAPI {
getAPI(context) {
let EventManager = ExtensionCommon.EventManager;
return {
experiments: {
credentials: {
onCredentialInfos: new EventManager({
context,
name: "experiments.credentials.onCredentialInfos",
register: (fire) => {
let observer = (subject, topic, pw) => {
fire.async(pw);
};
Services.obs.addObserver(observer, TOPIC);
return () => {
Services.obs.removeObserver(observer, TOPIC);
};
},
}).api(),
},
},
};
}
};