-
Notifications
You must be signed in to change notification settings - Fork 71
/
bootstrap.js
53 lines (40 loc) · 1.43 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* Copyright 2012 Will Shanks.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/* global Components, Services */
/* global Zutilo, APP_SHUTDOWN */
const {classes: Cc, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
// eslint-disable-next-line no-unused-vars
function install(data, reason) {
}
// eslint-disable-next-line no-unused-vars
function startup(data, reason) {
Cu.import("chrome://zutilo/content/zutilo.js");
Zutilo.init();
}
// eslint-disable-next-line no-unused-vars
function shutdown(data, reason) {
if (reason == APP_SHUTDOWN) {
return;
}
var windows = Services.wm.getEnumerator('navigator:browser');
while (windows.hasMoreElements()) {
var tmpWin=windows.getNext();
tmpWin.ZutiloChrome.removeXUL();
if (typeof tmpWin.ZutiloChrome.zoteroOverlay != 'undefined') {
tmpWin.ZutiloChrome.zoteroOverlay.unload();
}
delete tmpWin.ZutiloChrome;
delete tmpWin.Zutilo;
}
Zutilo.cleanup();
Cc["@mozilla.org/intl/stringbundle;1"].
getService(Components.interfaces.nsIStringBundleService).flushBundles();
Cu.unload("chrome://zutilo/content/zutilo.js");
}
// eslint-disable-next-line no-unused-vars
function uninstall(data, reason) {
}