From 433ed8cdca328b6077c8aa84155882af361aeafa Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Wed, 22 Sep 2010 19:17:33 +0000 Subject: v2.5, supports FF4.0 betas and has simplified chinese locale. git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@370 119bf307-c92d-0410-89bd-8f53e6181181 --- components/redirector.component.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'components') diff --git a/components/redirector.component.js b/components/redirector.component.js index ee2e584..751f548 100644 --- a/components/redirector.component.js +++ b/components/redirector.component.js @@ -6,6 +6,9 @@ Cr = Components.results; Cc = Components.classes; const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader); +function rdump(msg) { + //dump('\nREDIRECTOR: ' + msg); +} var redirector = null; function Redirector() { this._init(); @@ -16,6 +19,7 @@ try { loader.loadSubScript('chrome://redirector/content/code/redirect.js'); loader.loadSubScript('chrome://redirector/content/code/redirectorprefs.js'); } catch(e) { + rdump('ERROR: ' + e); for (i in e) { Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).logStringMessage('REDIRECTOR: Loading Redirector implementation failed: ' + i + e[i]); } @@ -32,12 +36,16 @@ xpcomInfo._xpcom_factory = { createInstance: function(outer, iid) { if (outer) throw Cr.NS_ERROR_NO_AGGREGATION; if (redirector == null) { + rdump('Creating new instance'); redirector = new Redirector(); + } else { + rdump('Using existing instance'); } return redirector.QueryInterface(iid); } }; -function NSGetModule(compMgr, fileSpec) { - return XPCOMUtils.generateModule([Redirector]); -} +if (XPCOMUtils.generateNSGetFactory) + var NSGetFactory = XPCOMUtils.generateNSGetFactory([Redirector]); +else + var NSGetModule = XPCOMUtils.generateNSGetModule([Redirector]); \ No newline at end of file -- cgit v1.2.3-70-g09d2