michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const XULRUNTIME_CONTRACTID = "@mozilla.org/xre/runtime;1"; michael@0: const XULRUNTIME_CID = Components.ID("7685dac8-3637-4660-a544-928c5ec0e714}"); michael@0: michael@0: Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: michael@0: let gAppInfo = null; michael@0: michael@0: function createAppInfo(id, name, version, platformVersion) { michael@0: gAppInfo = { michael@0: // nsIXULAppInfo michael@0: vendor: "Mozilla", michael@0: name: name, michael@0: ID: id, michael@0: version: version, michael@0: appBuildID: "2007010101", michael@0: platformVersion: platformVersion ? platformVersion : "1.0", michael@0: platformBuildID: "2007010101", michael@0: michael@0: // nsIXULRuntime michael@0: inSafeMode: false, michael@0: logConsoleErrors: true, michael@0: OS: "XPCShell", michael@0: replacedLockTime: 0, michael@0: XPCOMABI: "noarch-spidermonkey", michael@0: invalidateCachesOnRestart: function invalidateCachesOnRestart() { michael@0: // Do nothing michael@0: }, michael@0: michael@0: // nsICrashReporter michael@0: annotations: { michael@0: }, michael@0: michael@0: annotateCrashReport: function(key, data) { michael@0: this.annotations[key] = data; michael@0: }, michael@0: michael@0: QueryInterface: XPCOMUtils.generateQI([Ci.nsIXULAppInfo, michael@0: Ci.nsIXULRuntime, michael@0: Ci.nsICrashReporter, michael@0: Ci.nsISupports]) michael@0: }; michael@0: michael@0: let XULAppInfoFactory = { michael@0: createInstance: function (outer, iid) { michael@0: if (outer != null) michael@0: throw Components.results.NS_ERROR_NO_AGGREGATION; michael@0: return gAppInfo.QueryInterface(iid); michael@0: } michael@0: }; michael@0: let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); michael@0: registrar.registerFactory(XULRUNTIME_CID, "XULRuntime", michael@0: XULRUNTIME_CONTRACTID, XULAppInfoFactory); michael@0: michael@0: }