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 --- build.py | 2 +- chrome/js/component.js | 2 +- chrome/js/redirector.js | 21 ++++++--------------- chrome/unittest/run.html | 9 ++++----- defaults/preferences/redirector.preferences.js | 4 ---- install.rdf | 2 +- locale/en-US/redirector.properties | 2 -- 7 files changed, 13 insertions(+), 29 deletions(-) diff --git a/build.py b/build.py index 10f65da..4225bf0 100644 --- a/build.py +++ b/build.py @@ -1,6 +1,6 @@ import os, os.path, zipfile -xpi = zipfile.ZipFile('redirector-2.7.xpi','w') +xpi = zipfile.ZipFile('redirector-2.7.1.xpi','w') for (root, folders, files) in os.walk('.'): if 'unittest' in root: continue 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

diff --git a/defaults/preferences/redirector.preferences.js b/defaults/preferences/redirector.preferences.js index 66f0cdd..4464a8a 100644 --- a/defaults/preferences/redirector.preferences.js +++ b/defaults/preferences/redirector.preferences.js @@ -6,7 +6,3 @@ pref("extensions.redirector.showStatusBarIcon", true); pref("extensions.redirector.version", 'undefined'); pref("extensions.redirector.defaultDir", ''); pref("extensions.redirector.proxyServerPort", 4815); - -// See http://kb.mozillazine.org/Localize_extension_descriptions -pref("extensions.redirector@einaregilsson.com.description", "chrome://redirector/locale/redirector.properties"); - diff --git a/install.rdf b/install.rdf index 813af8c..059caf9 100644 --- a/install.rdf +++ b/install.rdf @@ -4,7 +4,7 @@ redirector@einaregilsson.com Redirector - 2.7 + 2.7.1 Einar Egilsson Automatically redirects to user-defined urls on certain pages http://einaregilsson.com/projects/redirector/ diff --git a/locale/en-US/redirector.properties b/locale/en-US/redirector.properties index a868161..09e4910 100644 --- a/locale/en-US/redirector.properties +++ b/locale/en-US/redirector.properties @@ -1,5 +1,4 @@ initError=Failed to initialize Redirector. -extensions.redirector@einaregilsson.com.description=Automatically redirects to user-defined urls on certain pages extensionName=Redirector addCurrentUrl=Add current url to Redirector addLinkUrl=Add link url to Redirector @@ -24,7 +23,6 @@ allExistedMessage=All %S redirects in the file were identical to existing redire allExistedMessageSingular=The single redirect in the file was identical to an existing redirect and was therefore not imported. importedNone=There were no usable redirects in the given file, no redirects were imported. importResult=Import results -invalidRedirectTitle=Redirector Add-on: Invalid Redirect detected invalidRedirectText=The pattern "%S" redirected the url %S to %S which also matches the pattern. This will cause an endless loop and so the redirect has been disabled to prevent this from happening. You should edit this redirect to fix it. warningExampleUrlDoesntMatchPatternTitle=Warning: Example url does not match redirect warningExampleUrlDoesntMatchPattern=The example url does not match the redirect specified. Are you sure you want to save this redirect? -- cgit v1.2.3-70-g09d2