forked from mook/moslack
/
bootstrap.js
37 lines (33 loc) · 1.3 KB
/
bootstrap.js
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
28
29
30
31
32
33
34
35
36
37
const {classes: Cc, interfaces: Ci, manager: Cm, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
function install() {
}
function startup(data, reason) {
Cu.import(Services.io.newURI("prpl.jsm", null, data.resourceURI).spec);
Components.manager
.nsIComponentRegistrar
.registerFactory(SlackPrpl.prototype.classID,
SlackPrpl.prototype.name,
SlackPrpl.prototype.contractID,
NSGetFactory(SlackPrpl.prototype.classID));
Cc["@mozilla.org/categorymanager;1"]
.getService(Ci.nsICategoryManager)
.addCategoryEntry("im-protocol-plugin",
"prpl-slack",
SlackPrpl.prototype.contractID,
false,
true);
}
function shutdown(data, reason) {
Cc["@mozilla.org/categorymanager;1"]
.getService(Ci.nsICategoryManager)
.deleteCategoryEntry("im-protocol-plugin",
"prpl-slack",
false);
Components.manager
.nsIComponentRegistrar
.unregisterFactory(SlackPrpl.prototype.classID,
NSGetFactory(SlackPrpl.prototype.classID));
}
function uninstall() {
}