added "guerilla about" (yes, i know about "licenses" issuses; sorry)
[guerillascript.git] / bootstrap.js
blobd3cce436c3120b499627a147132182081386b5f6
1 /* coded by Ketmar // Invisible Vector (psyc://ketmar.no-ip.org/~Ketmar)
2 * Understanding is not required. Only obedience.
4 * This program is free software. It comes without any warranty, to
5 * the extent permitted by applicable law. You can redistribute it
6 * and/or modify it under the terms of the Do What The Fuck You Want
7 * To Public License, Version 2, as published by Sam Hocevar. See
8 * http://www.wtfpl.net/txt/copying/ for more details.
9 */
10 ////////////////////////////////////////////////////////////////////////////////
11 let debugOptions = {
12 debugMode: false,
13 debugCache: false,
14 logEnabled: true,
15 openConsole: false,
19 let guerillaOptions = {
20 active: true,
24 ////////////////////////////////////////////////////////////////////////////////
25 // load "include/basic.js", which will provide various services
26 (function (global) {
27 const Cu = global.Components.utils;
28 let scope = {};
29 Cu.import("resource://gre/modules/Services.jsm", scope);
30 let uri = scope.Services.io.newURI(global.__SCRIPT_URI_SPEC__+"/../includes/basic.js", null, null);
31 try {
32 scope.Services.scriptloader.loadSubScript(uri.spec, global);
33 } catch (e) {
34 Cu.reportError("INIT ERROR "+e.name+": "+e.message)
35 Cu.reportError(e);
36 Cu.reportError(e.stack);
37 throw e;
39 })(this);
42 ////////////////////////////////////////////////////////////////////////////////
43 include("utils");
44 include("prefs");
47 let {oneShotTimer, intervalTimer} = require("timer");
48 addExport("oneShotTimer", oneShotTimer);
49 addExport("intervalTimer", intervalTimer);
51 let scacheAPI = require("scriptcache");
52 addExport("scacheAPI", scacheAPI);
54 let {wlRegister, wlUnregister, deinitInjectorStorage} = require("injector");
56 let {gcliInit, gcliDeinit} = require("concmd");
59 ////////////////////////////////////////////////////////////////////////////////
60 // ADDON_INSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE
61 function install (data, reason) {}
64 // ADDON_UNINSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE
65 function uninstall (data, reason) {}
68 ////////////////////////////////////////////////////////////////////////////////
69 // APP_STARTUP, ADDON_ENABLE, ADDON_INSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE
70 function startup (data, reason) {
71 //scacheAPI.validate();
72 setDefaultPrefs(); // always set the default prefs as they disappear on restart
73 initPrefs();
74 gcliInit();
75 wlRegister();
79 // APP_SHUTDOWN, ADDON_DISABLE, ADDON_UNINSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE
80 function shutdown (data, reason) {
81 deinitInjectorStorage();
82 //if (reason == APP_SHUTDOWN) return;
83 gcliDeinit();
84 wlUnregister();
85 deinitPrefs();