[Pkg-mozext-commits] [wot] 151/226: Fixed: incorrect URL of welcome page after redirections are done.
David Prévot
taffit at moszumanska.debian.org
Fri May 1 00:35:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository wot.
commit b224687f24028c8a47b950b9059a3ff97adba8f8
Author: Sergey Andryukhin <sorgoz at yandex.com>
Date: Thu Sep 5 13:29:15 2013 +0300
Fixed: incorrect URL of welcome page after redirections are done.
---
content/config.js | 8 ++++----
content/core.js | 4 ++--
content/firstrun.js | 6 ++++--
content/util.js | 4 ++--
4 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/content/config.js b/content/config.js
index b557a6d..db18bb6 100644
--- a/content/config.js
+++ b/content/config.js
@@ -221,10 +221,10 @@ const WOT_BLOCK_BLOCKED = "chrome://wot/locale/blocked.html";
*/
const WOT_PREF_PATH = "settings/";
-const WOT_PREF_FORWARD_TAB_MATCH = 7;
+const WOT_PREF_FORWARD_TAB_MATCH = 8;
const WOT_PREF_FORWARD_TAB_BASE = 1;
-const WOT_PREF_FORWARD = /^(http(s)?\:\/\/(.+\.)?mywot\.com)\/([^\/]{2}(-[^\/]+)?\/)?(settings|update)(\/([^\/]+))?\/?(\?.+)?$/;
-const WOT_PREF_TRIGGER = /^(http(s)?\:\/\/(.+\.)?mywot\.com)\/([^\/]{2}(-[^\/]+)?\/)?(settings|update)\/.+/;
+const WOT_PREF_FORWARD = /^(http(s)?\:\/\/(.+\.)?mywot\.com)\/([^\/]{2}(-[^\/]+)?\/)?(settings)(\/([^\/]+))?\/?(\?.+)?$/;
+const WOT_PREF_TRIGGER = /^(http(s)?\:\/\/(.+\.)?mywot\.com)\/([^\/]{2}(-[^\/]+)?\/)?(settings)\/.+/;
const WOT_PREF = "weboftrust.";
@@ -246,7 +246,7 @@ const WOT_SEARCH_TYPE_APP0 = 2;
/* First run */
const WOT_FIRSTRUN_WELCOME = 1;
const WOT_FIRSTRUN_CURRENT = 3;
-const WOT_UPDATE_PATH = "update/";
+const WOT_UPDATE_PATH = "update";
/* Preferences and defaults */
diff --git a/content/core.js b/content/core.js
index ff075ad..77c5f40 100644
--- a/content/core.js
+++ b/content/core.js
@@ -579,9 +579,9 @@ var wot_core =
if (match) {
var section = match[WOT_PREF_FORWARD_TAB_MATCH];
- var base = (match[WOT_PREF_FORWARD_TAB_BASE] + "/settings") || WOT_PREF_PATH;
+ var base = (match[WOT_PREF_FORWARD_TAB_BASE] + "/settings/") || WOT_PREF_PATH;
- getBrowser().loadURIWithFlags(wot_url.getprefurl(section, base),
+ getBrowser().loadURIWithFlags(wot_url.getprefurl(section, false, base),
Components.interfaces.nsIWebNavigation
.LOAD_FLAGS_BYPASS_HISTORY, null, null);
}
diff --git a/content/firstrun.js b/content/firstrun.js
index e28c4de..8206999 100644
--- a/content/firstrun.js
+++ b/content/firstrun.js
@@ -73,8 +73,10 @@ var wot_firstrun =
wot_prefs.setChar("firstrun_time", past_date);
}
- this.opentab(WOT_FIRSTRUN_CURRENT,
- wot_url.getprefurl(partner, false, WOT_UPDATE_PATH));
+ var update_url = [ WOT_MY_URL.replace(/^(.+)\/$/,"$1"), WOT_UPDATE_PATH,
+ wot_util.getstring("lang"), WOT_PLATFORM, WOT_VERSION ].join("/");
+ this.opentab(WOT_FIRSTRUN_CURRENT, update_url);
+
} else {
// the add-on is launched first time
// remember the date/time of the first launch
diff --git a/content/util.js b/content/util.js
index 2ae9b6b..9e228f9 100644
--- a/content/util.js
+++ b/content/util.js
@@ -329,6 +329,7 @@ var wot_url =
getprefurl: function(tab, secure, base, context)
{
try {
+ var has_base = !!base;
base = base || WOT_PREF_PATH;
var path = base + wot_util.getstring("lang") +
@@ -341,13 +342,12 @@ var wot_url =
url += "/" + tab;
}
- url = this.getwoturl(url, context);
+ url = this.getwoturl(url, context, has_base);
if (secure || wot_core.force_https) {
url = url.replace(/^http\:/, "https:");
}
-
return url;
}
} catch (e) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/wot.git
More information about the Pkg-mozext-commits
mailing list