-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathbootstrap.ts
More file actions
31 lines (26 loc) · 991 Bytes
/
bootstrap.ts
File metadata and controls
31 lines (26 loc) · 991 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
28
29
30
31
export function install() {}
export function uninstall() {}
let chromeHandle
export async function startup({ id, version, rootURI }) {
const aomStartup = Components.classes['@mozilla.org/addons/addon-manager-startup;1'].getService(Components.interfaces.amIAddonManagerStartup)
const manifestURI = Services.io.newURI(`${rootURI}manifest.json`)
chromeHandle = aomStartup.registerChrome(manifestURI, [
['content', 'zotero-folder-import', 'content/'],
])
Services.scriptloader.loadSubScript(`${rootURI}content/folder-import.js`, { rootURI, Zotero })
await Zotero.FolderImport.startup()
}
export async function shutdown() {
await Zotero.FolderImport.shutdown()
if (chromeHandle) {
chromeHandle.destruct()
chromeHandle = undefined
}
Zotero.FolderImport = null
}
export function onMainWindowLoad({ window }) {
Zotero.FolderImport?.onMainWindowLoad(window)
}
export function onMainWindowUnload({ window }) {
Zotero.FolderImport?.onMainWindowUnload(window)
}