michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} = Components; michael@0: michael@0: let gSyncProfile = do_get_profile(); michael@0: michael@0: Cu.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: michael@0: let XULAppInfo = { michael@0: vendor: "Mozilla", michael@0: name: "XPCShell", michael@0: ID: "xpcshell@tests.mozilla.org", michael@0: version: "1", michael@0: appBuildID: "20100621", michael@0: platformVersion: "", michael@0: platformBuildID: "20100621", michael@0: inSafeMode: false, michael@0: logConsoleErrors: true, michael@0: OS: "XPCShell", michael@0: XPCOMABI: "noarch-spidermonkey", michael@0: QueryInterface: XPCOMUtils.generateQI([Ci.nsIXULAppInfo, Ci.nsIXULRuntime]), michael@0: invalidateCachesOnRestart: function invalidateCachesOnRestart() { } michael@0: }; michael@0: michael@0: let XULAppInfoFactory = { michael@0: createInstance: function (outer, iid) { michael@0: if (outer != null) michael@0: throw Cr.NS_ERROR_NO_AGGREGATION; michael@0: return XULAppInfo.QueryInterface(iid); michael@0: } michael@0: }; michael@0: michael@0: let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); michael@0: registrar.registerFactory(Components.ID("{fbfae60b-64a4-44ef-a911-08ceb70b9f31}"), michael@0: "XULAppInfo", "@mozilla.org/xre/app-info;1", michael@0: XULAppInfoFactory); michael@0: michael@0: function addResourceAlias() { michael@0: Cu.import("resource://gre/modules/Services.jsm"); michael@0: const handler = Services.io.getProtocolHandler("resource") michael@0: .QueryInterface(Ci.nsIResProtocolHandler); michael@0: michael@0: let modules = ["common", "crypto"]; michael@0: for each (let module in modules) { michael@0: let uri = Services.io.newURI("resource://gre/modules/services-" + module + "/", michael@0: null, null); michael@0: handler.setSubstitution("services-" + module, uri); michael@0: } michael@0: } michael@0: addResourceAlias();