forked from martok/palefill
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.js
More file actions
51 lines (43 loc) · 1.34 KB
/
bootstrap.js
File metadata and controls
51 lines (43 loc) · 1.34 KB
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
/*
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/.
Pale Moon Web Technologies Add-on
Copyright (c) 2020-22 Martok & Contributors. All rights reserved.
*/
"use strict";
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
let addonData = null;
function require(module)
{
let scopes = require.scopes;
if (!(module in scopes)) {
let url = addonData.resourceURI.spec + "lib/" + module + ".js";
scopes[module] = {
Cc, Ci, Cu, require,
exports: {}
};
Services.scriptloader.loadSubScript(url, scopes[module]);
}
return scopes[module].exports;
}
require.scopes = Object.create(null);
function startup(data, reason) {
addonData = data;
const settings = require("settings").getService();
settings.init("extensions.palefill.", addonData);
settings.setDefaults(require("settings-defaults"));
require("main").init();
}
function shutdown(data, reason) {
if (reason == APP_SHUTDOWN) {
return;
}
require("main").done();
require("settings").getService().done();
require.scopes = {};
addonData = null;
}
function install() {}
function uninstall() {}