File: bootstrap.js

package info (click to toggle)
tinyjsd 1.2%2Bgit1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 316 kB
  • sloc: makefile: 21
file content (49 lines) | stat: -rw-r--r-- 1,394 bytes parent folder | download
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
/*global Components: false */
/* 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";


const Cu = Components.utils;

/* global APP_STARTUP: false, APP_SHUTDOWN: false */

function install() {}

function uninstall() {}

function startup(data, reason) {
  const {
    TinyjsdFactory
  } = Cu.import("chrome://tinyJsd/content/modules/tinyjsdFactory.jsm", {});
  const {
    TinyjsdOverlays
  } = Cu.import("chrome://tinyJsd/content/modules/tinyjsd-overlays.jsm", {});

  TinyjsdFactory.startup(reason, data);
  TinyjsdOverlays.startup(reason, data);

  // to communicate with WebExtension API:
  // data.webExtension.startup().then(api => {
  // });
}

function shutdown(data, reason) {
  if (reason === APP_SHUTDOWN) return;

  const {
    TinyjsdFactory
  } = Cu.import("chrome://tinyJsd/content/modules/tinyjsdFactory.jsm", {});
  const {
    TinyjsdOverlays
  } = Cu.import("chrome://tinyJsd/content/modules/tinyjsd-overlays.jsm", {});

  TinyjsdFactory.shutdown(reason, data);
  TinyjsdOverlays.shutdown(reason, data);

  Cu.unload("chrome://tinyJsd/content/modules/tinyjsd-overlays.jsm");
  Cu.unload("chrome://tinyJsd/content/modules/tinyjsdCommon.jsm");
  Cu.unload("chrome://tinyJsd/content/modules/tinyjsdFactory.jsm");
}