-// Copyright (c) 2008-2013 Kris Maglione <maglione.k at Gmail>
+// Copyright (c) 2008-2014 Kris Maglione <maglione.k at Gmail>
//
// This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file.
this.add("clipboardHelper", "@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper");
this.add("commandLineHandler", "@mozilla.org/commandlinehandler/general-startup;1?type=dactyl");
this.add("console", "@mozilla.org/consoleservice;1", "nsIConsoleService");
- this.add("contentPrefs", "@mozilla.org/content-pref/service;1", "nsIContentPrefService");
+ this.add("contentPrefs", "@mozilla.org/content-pref/service;1", ["nsIContentPrefService",
+ "nsIContentPrefService2"]);
this.add("dactyl", "@dactyl.googlecode.com/extra/utils", "dactylIUtils");
this.add("dactyl:", this.PROTOCOL + "dactyl");
this.add("debugger", "@mozilla.org/js/jsd/debugger-service;1", "jsdIDebuggerService");
this.add("mime", "@mozilla.org/mime;1", "nsIMIMEService");
this.add("observer", "@mozilla.org/observer-service;1", "nsIObserverService");
this.add("pref", "@mozilla.org/preferences-service;1", ["nsIPrefBranch2", "nsIPrefService"]);
+ this.add("printSettings", "@mozilla.org/gfx/printsettings-service;1", "nsIPrintSettingsService");
this.add("privateBrowsing", "@mozilla.org/privatebrowsing;1", "nsIPrivateBrowsingService");
this.add("profile", "@mozilla.org/toolkit/profile-service;1", "nsIToolkitProfileService");
this.add("resource:", this.PROTOCOL + "resource", ["nsIProtocolHandler", "nsIResProtocolHandler"]);
this.addClass("URL", "@mozilla.org/network/standard-url;1", ["nsIStandardURL", "nsIURL"], "init");
this.addClass("Xmlhttp", "@mozilla.org/xmlextras/xmlhttprequest;1", [], "open");
this.addClass("XPathEvaluator", "@mozilla.org/dom/xpath-evaluator;1", "nsIDOMXPathEvaluator");
- this.addClass("XMLDocument", "@mozilla.org/xml/xml-document;1", ["nsIDOMXMLDocument", "nsIDOMNodeSelector"]);
+ this.addClass("XMLDocument", "@mozilla.org/xml/xml-document;1", "nsIDOMXMLDocument");
this.addClass("XMLSerializer","@mozilla.org/xmlextras/xmlserializer;1", ["nsIDOMSerializer"]);
this.addClass("ZipReader", "@mozilla.org/libjar/zip-reader;1", "nsIZipReader", "open", false);
this.addClass("ZipWriter", "@mozilla.org/zipwriter;1", "nsIZipWriter", "open", false);
if (!service.interfaces.length)
return res.wrappedJSObject || res;
- service.interfaces.forEach(function (iface) res instanceof Ci[iface]);
+ service.interfaces.forEach(iface => { res instanceof Ci[iface]; });
+
if (service.init && args.length) {
if (service.callable)
res[service.init].apply(res, args);
this.services[name] = { method: meth, class: class_, interfaces: Array.concat(ifaces || []) };
if (name in this && ifaces && !this.__lookupGetter__(name) && !(this[name] instanceof Ci.nsISupports))
throw TypeError();
- memoize(this, name, function () self._create(name));
+ memoize(this, name, () => self._create(name));
},
/**
function () callable(XPCOMShim(this.interfaces)[this.init]));
this[name] = (function Create() this._create(name, arguments)).bind(this);
- update.apply(null, [this[name]].concat([Ci[i] for each (i in Array.concat(ifaces))]));
+ update.apply(null, [this[name]].concat([Ci[i] for (i of Array.concat(ifaces))]));
return this[name];
},
*
* @param {string} name The service's cache key.
*/
- has: function has(name) Set.has(this.services, name) && this.services[name].class in Cc &&
- this.services[name].interfaces.every(function (iface) iface in Ci)
+ has: function has(name) hasOwnProperty(this.services, name) && this.services[name].class in Cc &&
+ this.services[name].interfaces.every(iface => iface in Ci)
});
endModule();