diff options
Diffstat (limited to 'components/redirector.component.js')
-rw-r--r-- | components/redirector.component.js | 14 |
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 |