From 5a68a9c070e45f4a8366f0baed90befe685f2824 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Sun, 8 Jan 2012 06:41:57 +0100 Subject: 2.7.1 --- chrome/js/component.js | 2 +- chrome/js/redirector.js | 21 ++++++--------------- chrome/unittest/run.html | 9 ++++----- 3 files changed, 11 insertions(+), 21 deletions(-) (limited to 'chrome') diff --git a/chrome/js/component.js b/chrome/js/component.js index 7b19109..c0ec562 100644 --- a/chrome/js/component.js +++ b/chrome/js/component.js @@ -7,7 +7,7 @@ Components.utils.import("chrome://redirector/content/js/redirector.js"); function RedirectorComponent() { } RedirectorComponent.prototype = { - classDescription: "My Hello World Javascript XPCOM Component", + classDescription: "Redirector", classID: Components.ID("{b7a7a54f-0581-47ff-b086-d6920cb7a3f7}"), contractID: "@einaregilsson.com/redirector;1", QueryInterface: function(iid) { diff --git a/chrome/js/redirector.js b/chrome/js/redirector.js index 0250438..d2bcc51 100644 --- a/chrome/js/redirector.js +++ b/chrome/js/redirector.js @@ -3,11 +3,7 @@ Components.utils.import("chrome://redirector/content/js/redirect.js"); Components.utils.import("chrome://redirector/content/js/redirectorprefs.js"); //Components.utils.import("chrome://redirector/content/js/proxyserver.js"); -var EXPORTED_SYMBOLS = ['Redirector', 'rdump']; - -function rdump(msg) { - Redirector.debug(msg); -} +var EXPORTED_SYMBOLS = ['Redirector']; Redirector = { @@ -81,12 +77,11 @@ Redirector = { //check for loops... result = redirect.getMatch(redirectUrl); if (result.isMatch) { - var title = this._getString('invalidRedirectTitle'); var msg = this._getFormattedString('invalidRedirectText', [redirect.includePattern, url, redirectUrl]); this.debug(msg); redirect.disabled = true; - this.save(); - this._msgBox(title, msg); + this.save(); + ConsoleService.logStringMessage('Redirector: ' + msg); } else { this.debug('Redirecting ' + url + ' to ' + redirectUrl); return redirectUrl; @@ -110,7 +105,7 @@ Redirector = { }, handleUpgrades : function(){ - var currentVersion = '2.7'; + var currentVersion = '2.7.1'; this._list = []; if (this._prefs.version == currentVersion) { @@ -297,8 +292,8 @@ Redirector = { if (this._prefs) { this._prefs.dispose(); } - ConsoleService.logStringMessage('REDIRECTOR CREATED'); this._prefs = new RedirectorPrefs(); + this.debug('REDIRECTOR CREATED'); //Check if we need to update existing redirects var data = this._prefs.redirects; var version = this._prefs.version; @@ -311,7 +306,7 @@ Redirector = { } //RedirectorProxy.start(this._prefs.proxyServerPort); - //rdump('Registering as Proxy Filter'); + //Redirector.debug('Registering as Proxy Filter'); //var pps = Cc["@mozilla.org/network/protocol-proxy-service;1"].getService(Ci.nsIProtocolProxyService); //pps.registerFilter(this, 0); }, @@ -339,10 +334,6 @@ Redirector = { return this._strings.formatStringFromName(name, params, params.length); }, - _msgBox : function(title, text) { - PromptService.alert(null, title, text); - }, - _makeAbsoluteUrl : function(currentUrl, relativeUrl) { if (relativeUrl.match(/https?:/)) { diff --git a/chrome/unittest/run.html b/chrome/unittest/run.html index cc178aa..1c056d5 100644 --- a/chrome/unittest/run.html +++ b/chrome/unittest/run.html @@ -15,8 +15,9 @@ +

Redirector Unit Tests

-- cgit v1.2.3-70-g09d2