From 50d488f4c2137206e63f291ff99c4f09d177d31d Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Tue, 15 Sep 2009 08:00:03 +0000 Subject: Fixed the wildcard match and added a bunch of unit tests. git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@247 119bf307-c92d-0410-89bd-8f53e6181181 --- components/redirector.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'components/redirector.js') diff --git a/components/redirector.js b/components/redirector.js index d0d9694..1653c23 100644 --- a/components/redirector.js +++ b/components/redirector.js @@ -9,17 +9,16 @@ var kRedirectorWildcard = 'W'; var kRedirectorRegex= 'R'; var nsIContentPolicy = Ci.nsIContentPolicy; -function RedirectorPolicy() { +function Redirector() { this.init(); } try { -Cc["@mozilla.org/moz/jssubscript-loader;1"] - .getService(Ci.mozIJSSubScriptLoader) - .loadSubScript('chrome://redirector/content/redirector.prototype.js'); -}catch(e) { -Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).logStringMessage(e); - + Cc["@mozilla.org/moz/jssubscript-loader;1"] + .getService(Ci.mozIJSSubScriptLoader) + .loadSubScript('chrome://redirector/content/redirector.prototype.js'); +} catch(e) { + Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).logStringMessage('Loading Redirector implementation failed: ' + e); } /* * Factory object @@ -42,7 +41,7 @@ const factory = { } if(!redirectorInstance) { - redirectorInstance = new RedirectorPolicy(); + redirectorInstance = new Redirector(); redirectorInstance.wrappedJSObject = redirectorInstance; } -- cgit v1.2.3-70-g09d2