diff options
author | Einar Egilsson | 2009-09-15 08:00:03 +0000 |
---|---|---|
committer | Einar Egilsson | 2009-09-15 08:00:03 +0000 |
commit | 50d488f4c2137206e63f291ff99c4f09d177d31d (patch) | |
tree | 9b98d5382de8803c00fbeb5a32041fa43582cc0f /components/redirector.js | |
parent | 0225b1c8035a1c03dafa4c971d21facc76dbc2de (diff) |
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
Diffstat (limited to 'components/redirector.js')
-rw-r--r-- | components/redirector.js | 15 |
1 files changed, 7 insertions, 8 deletions
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;
}
|