1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-10 13:45:47 +01:00

Use services.dactyl when available.

This commit is contained in:
Kris Maglione
2011-09-22 21:55:58 -04:00
parent 6af256bc53
commit e1db34990b
6 changed files with 147 additions and 31 deletions

10
common/bootstrap.js vendored
View File

@@ -58,6 +58,13 @@ let components = {};
let resources = [];
let getURI = null;
function updateLoader() {
try {
JSMLoader.loader = Cc["@dactyl.googlecode.com/extra/utils"].getService(Ci.dactylIUtils);
}
catch (e) {};
}
/**
* Performs necessary migrations after a version change.
*/
@@ -100,6 +107,8 @@ function startup(data, reason) {
name = data.id.replace(/@.*/, "");
AddonManager.getAddonByID(addon.id, function (a) {
addon = a;
updateLoader();
updateVersion();
if (typeof require !== "undefined")
require(global, "main");
@@ -259,6 +268,7 @@ function init() {
Services.obs.notifyObservers(null, "dactyl-rehash", null);
updateVersion();
updateLoader();
if (addon !== addonData)
require(global, "main");
}