From 3c1f07fa816bf348555b96b5b7df9a29675de09a Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Fri, 16 Oct 2009 14:39:31 +0000 Subject: Redirector 2.0 Candidate 3 git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@275 119bf307-c92d-0410-89bd-8f53e6181181 --- components/redirector.component.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'components/redirector.component.js') diff --git a/components/redirector.component.js b/components/redirector.component.js index 6dce455..e5f20f4 100644 --- a/components/redirector.component.js +++ b/components/redirector.component.js @@ -6,6 +6,7 @@ Cr = Components.results; Cc = Components.classes; const loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader); +var redirector = null; function Redirector() { this.init(); this.wrappedJSObject = this; @@ -31,6 +32,9 @@ xpcomInfo.QueryInterface = XPCOMUtils.generateQI([Ci.nsIContentPolicy, Ci.nsICh xpcomInfo._xpcom_factory = { createInstance: function(outer, iid) { if (outer) throw Cr.NS_ERROR_NO_AGGREGATION; + if (redirector == null) { + redirector = new Redirector(); + } return redirector.QueryInterface(iid); } }; @@ -38,5 +42,3 @@ xpcomInfo._xpcom_factory = { function NSGetModule(compMgr, fileSpec) { return XPCOMUtils.generateModule([Redirector]); } - -const redirector = new Redirector(); -- cgit v1.2.3-70-g09d2