aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorEinar Egilsson2010-09-22 19:17:33 +0000
committerEinar Egilsson2010-09-22 19:17:33 +0000
commit433ed8cdca328b6077c8aa84155882af361aeafa (patch)
tree20eb960cdafce7a945d496686c432ac530a9cff2 /components
parent68848a6d366282ae659ac9b00c97096fe1d41df5 (diff)
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
Diffstat (limited to 'components')
-rw-r--r--components/redirector.component.js14
1 files changed, 11 insertions, 3 deletions
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