mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 03:47:58 +01:00
Add missing services.tld.
This commit is contained in:
@@ -640,7 +640,7 @@ var Modes = Module("modes", {
|
|||||||
|
|
||||||
options.add(["showmode", "smd"],
|
options.add(["showmode", "smd"],
|
||||||
"Show the current mode in the command line when it matches this expression",
|
"Show the current mode in the command line when it matches this expression",
|
||||||
"stringlist", "!normal,base",
|
"stringlist", "caret,output_multiline,!normal,base",
|
||||||
opts);
|
opts);
|
||||||
},
|
},
|
||||||
prefs: function initPrefs() {
|
prefs: function initPrefs() {
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ function defineModule(name, params, module) {
|
|||||||
use[mod].push(module);
|
use[mod].push(module);
|
||||||
}
|
}
|
||||||
currentModule = module;
|
currentModule = module;
|
||||||
|
module.startTime = Date.now();
|
||||||
}
|
}
|
||||||
|
|
||||||
defineModule.loadLog = [];
|
defineModule.loadLog = [];
|
||||||
@@ -163,7 +164,6 @@ defineModule.dump = function dump_() {
|
|||||||
.replace(/^./gm, name + ": $&"));
|
.replace(/^./gm, name + ": $&"));
|
||||||
}
|
}
|
||||||
defineModule.modules = [];
|
defineModule.modules = [];
|
||||||
defineModule.times = { all: 0 };
|
|
||||||
defineModule.time = function time(major, minor, func, self) {
|
defineModule.time = function time(major, minor, func, self) {
|
||||||
let time = Date.now();
|
let time = Date.now();
|
||||||
if (typeof func !== "function")
|
if (typeof func !== "function")
|
||||||
@@ -176,13 +176,7 @@ defineModule.time = function time(major, minor, func, self) {
|
|||||||
loaded.util && util.reportError(e);
|
loaded.util && util.reportError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
let delta = Date.now() - time;
|
JSMLoader.times.add(major, minor, Date.now() - time);
|
||||||
defineModule.times.all += delta;
|
|
||||||
defineModule.times[major] = (defineModule.times[major] || 0) + delta;
|
|
||||||
if (minor) {
|
|
||||||
defineModule.times[":" + minor] = (defineModule.times[":" + minor] || 0) + delta;
|
|
||||||
defineModule.times[major + ":" + minor] = (defineModule.times[major + ":" + minor] || 0) + delta;
|
|
||||||
}
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), {
|
|||||||
return this.rootFolders.indexOf(root) >= 0;
|
return this.rootFolders.indexOf(root) >= 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Should be made thread safe.
|
|
||||||
load: function load() {
|
load: function load() {
|
||||||
let bookmarks = {};
|
let bookmarks = {};
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,26 @@ else
|
|||||||
manager: Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar),
|
manager: Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar),
|
||||||
stale: JSMLoader ? JSMLoader.stale : {},
|
stale: JSMLoader ? JSMLoader.stale : {},
|
||||||
suffix: "",
|
suffix: "",
|
||||||
|
|
||||||
|
times: {
|
||||||
|
all: 0,
|
||||||
|
add: function add(major, minor, delta) {
|
||||||
|
this.all += delta;
|
||||||
|
|
||||||
|
this[major] = (this[major] || 0) + delta;
|
||||||
|
if (minor) {
|
||||||
|
minor = ":" + minor;
|
||||||
|
this[minor] = (this[minor] || 0) + delta;
|
||||||
|
this[major + minor] = (this[major + minor] || 0) + delta;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clear: function clear() {
|
||||||
|
for (let key in this)
|
||||||
|
if (typeof this[key] !== "number")
|
||||||
|
delete this[key];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
init: function init(suffix) {
|
init: function init(suffix) {
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
this.suffix = suffix || "";
|
this.suffix = suffix || "";
|
||||||
@@ -41,6 +61,7 @@ else
|
|||||||
this.global.JSMLoader = this;
|
this.global.JSMLoader = this;
|
||||||
base.JSMLoader = this;
|
base.JSMLoader = this;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTarget: function getTarget(url) {
|
getTarget: function getTarget(url) {
|
||||||
if (url.indexOf(":") === -1)
|
if (url.indexOf(":") === -1)
|
||||||
url = "resource://dactyl" + this.suffix + "/" + url;
|
url = "resource://dactyl" + this.suffix + "/" + url;
|
||||||
@@ -49,6 +70,7 @@ else
|
|||||||
chan.cancel(Components.results.NS_BINDING_ABORTED);
|
chan.cancel(Components.results.NS_BINDING_ABORTED);
|
||||||
return chan.name;
|
return chan.name;
|
||||||
},
|
},
|
||||||
|
|
||||||
load: function load(name, target) {
|
load: function load(name, target) {
|
||||||
let url = name;
|
let url = name;
|
||||||
if (url.indexOf(":") === -1)
|
if (url.indexOf(":") === -1)
|
||||||
@@ -68,7 +90,12 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
let now = Date.now();
|
||||||
let global = Components.utils.import(url, target);
|
let global = Components.utils.import(url, target);
|
||||||
|
|
||||||
|
if (!(name in this.globals))
|
||||||
|
this.times.add("require", name, Date.now() - now);
|
||||||
|
|
||||||
return this.globals[name] = global;
|
return this.globals[name] = global;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
@@ -76,11 +103,18 @@ else
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadSubScript: function loadSubScript() this.loader.loadSubScript.apply(this.loader, arguments),
|
|
||||||
|
loadSubScript: function loadSubScript(script) {
|
||||||
|
let now = Date.now();
|
||||||
|
this.loader.loadSubScript.apply(this.loader, arguments);
|
||||||
|
this.times.add("loadSubScript", script, Date.now() - now);
|
||||||
|
},
|
||||||
|
|
||||||
cleanup: function unregister() {
|
cleanup: function unregister() {
|
||||||
for each (let factory in this.factories.splice(0))
|
for each (let factory in this.factories.splice(0))
|
||||||
this.manager.unregisterFactory(factory.classID, factory);
|
this.manager.unregisterFactory(factory.classID, factory);
|
||||||
},
|
},
|
||||||
|
|
||||||
purge: function purge() {
|
purge: function purge() {
|
||||||
dump("dactyl: JSMLoader: purge\n");
|
dump("dactyl: JSMLoader: purge\n");
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ var Services = Module("Services", {
|
|||||||
this.add("stylesheet", "@mozilla.org/content/style-sheet-service;1", "nsIStyleSheetService");
|
this.add("stylesheet", "@mozilla.org/content/style-sheet-service;1", "nsIStyleSheetService");
|
||||||
this.add("subscriptLoader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader");
|
this.add("subscriptLoader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader");
|
||||||
this.add("tagging", "@mozilla.org/browser/tagging-service;1", "nsITaggingService");
|
this.add("tagging", "@mozilla.org/browser/tagging-service;1", "nsITaggingService");
|
||||||
|
this.add("tld", "@mozilla.org/network/effective-tld-service;1", "nsIEffectiveTLDService");
|
||||||
this.add("threading", "@mozilla.org/thread-manager;1", "nsIThreadManager");
|
this.add("threading", "@mozilla.org/thread-manager;1", "nsIThreadManager");
|
||||||
this.add("urifixup", "@mozilla.org/docshell/urifixup;1", "nsIURIFixup");
|
this.add("urifixup", "@mozilla.org/docshell/urifixup;1", "nsIURIFixup");
|
||||||
this.add("versionCompare", "@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator");
|
this.add("versionCompare", "@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator");
|
||||||
|
|||||||
Reference in New Issue
Block a user