diff options
Diffstat (limited to 'common/modules')
-rw-r--r-- | common/modules/bootstrap.jsm | 17 | ||||
-rw-r--r-- | common/modules/config.jsm | 5 | ||||
-rw-r--r-- | common/modules/overlay.jsm | 4 | ||||
-rw-r--r-- | common/modules/sanitizer.jsm | 2 | ||||
-rw-r--r-- | common/modules/util.jsm | 2 |
5 files changed, 14 insertions, 16 deletions
diff --git a/common/modules/bootstrap.jsm b/common/modules/bootstrap.jsm index 5609bf68..00758bc0 100644 --- a/common/modules/bootstrap.jsm +++ b/common/modules/bootstrap.jsm @@ -5,7 +5,6 @@ "use strict"; try { -dump("=========== load bootstrap.jsm ===========\n"); if (!JSMLoader || JSMLoader.bump != 1) var JSMLoader = { @@ -16,6 +15,7 @@ if (!JSMLoader || JSMLoader.bump != 1) factories: [], globals: {}, io: Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService), + loader: Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader), manager: Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar), stale: {}, suffix: "", @@ -29,17 +29,13 @@ if (!JSMLoader || JSMLoader.bump != 1) if (url.indexOf(":") === -1) url = "resource://dactyl" + this.suffix + "/" + url; - let stale = this.stale[url]; - if (stale) { - dump("JSMLoader: load " + name + " " + stale + "\n"); - dump("JSMLoader: load " + name + " " + this.getTarget(url) + "\n"); + if (url in this.stale) { + let stale = this.stale[url]; delete this.stale[url]; let global = this.globals[url]; if (stale === this.getTarget(url)) - Components.classes["@mozilla.org/moz/jssubscript-loader;1"] - .getService(Components.interfaces.mozIJSSubScriptLoader) - .loadSubScript(url, global.global || global); + this.loadSubScript(url, global.global || global); } try { @@ -58,6 +54,7 @@ if (!JSMLoader || JSMLoader.bump != 1) throw e; } }, + loadSubScript: function loadSubScript() this.loader.loadSubScript.apply(this.loader, arguments), cleanup: function unregister() { for each (let factory in this.factories.splice(0)) this.manager.unregisterFactory(factory.classID, factory); @@ -94,6 +91,6 @@ Components.classes["@mozilla.org/fuel/application;1"] .storage.set("dactyl.JSMLoader", JSMLoader); JSMLoader.load("base.jsm", this); -dump("exports: " + this.JSMLoader+" " +this.EXPORTED_SYMBOLS + "\n"); -}catch(e){dump(e+"\n"+(e.stack || Error().stack));Components.utils.reportError(e)} +}catch(e){ dump(e + "\n" + (e.stack || Error().stack)); Components.utils.reportError(e) } + diff --git a/common/modules/config.jsm b/common/modules/config.jsm index c7d28aac..77110d9e 100644 --- a/common/modules/config.jsm +++ b/common/modules/config.jsm @@ -81,7 +81,8 @@ var ConfigBase = Class("ConfigBase", { } else { return array(f.leafName - for (f in util.getFile(uri).iterDirectory()) + // Fails on FF3: for (f in util.getFile(uri).iterDirectory()) + for (f in values(util.getFile(uri).readDirectory())) if (f.isDirectory())).array; } }), @@ -636,7 +637,7 @@ var ConfigBase = Class("ConfigBase", { ]]></>) }); -services.subscriptLoader.loadSubScript("resource://dactyl-local-content/config.js", this); +JSMLoader.loadSubScript("resource://dactyl-local-content/config.js", this); config.INIT = update(Object.create(config.INIT), config.INIT, { init: function init(dactyl, modules, window) { diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm index a1fa68d5..6ac9972e 100644 --- a/common/modules/overlay.jsm +++ b/common/modules/overlay.jsm @@ -88,7 +88,7 @@ var Overlay = Module("Overlay", { const create = window.Object.create || (function () { window.__dactyl_eval_string = "(function (proto) ({ __proto__: proto }))"; - services.subscriptLoader.loadSubScript(BASE + "eval.js", window); + JSMLoader.loadSubScript(BASE + "eval.js", window); let res = window.__dactyl_eval_result; delete window.__dactyl_eval_string; @@ -110,7 +110,7 @@ var Overlay = Module("Overlay", { load: function load(script) { for (let [i, base] in Iterator(prefix)) { try { - services.subscriptLoader.loadSubScript(base + script + ".js", modules, "UTF-8"); + JSMLoader.loadSubScript(base + script + ".js", modules, "UTF-8"); return; } catch (e) { diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index d211d288..ebc0b95c 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -21,7 +21,7 @@ defineModule("sanitizer", { }, this); let tmp = {}; -services.subscriptLoader.loadSubScript("chrome://browser/content/sanitize.js", tmp); +JSMLoader.loadSubScript("chrome://browser/content/sanitize.js", tmp); tmp.Sanitizer.prototype.__proto__ = Class.prototype; var Range = Struct("min", "max"); diff --git a/common/modules/util.jsm b/common/modules/util.jsm index eaa817d5..e2f09f7a 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -24,7 +24,7 @@ default xml namespace = XHTML; memoize(this, "Commands", function () { // FIXME let obj = { Module: Class }; - services.subscriptLoader.loadSubScript("chrome://dactyl/content/commands.js", obj); + JSMLoader.loadSubScript("resource://dactyl-content/commands.js", obj); return obj.Commands; }); |