GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Commit b7beaadb authored by Kathleen Brade's avatar Kathleen Brade
Browse files

ESR24 compat: compute correct paths for tor files.

Add a version check so Tor Launcher will find tor files in older versions
of Firefox (as well as in Firefox 21 and newer).
parent da3722db
......@@ -528,9 +528,13 @@ TorProcessService.prototype =
else
{
// For Firefox, paths are relative to the top of the TBB install.
// In FF21+, CurProcD is the "browser" directory that is next to
// the firefox binary, e.g., <TorFileBaseDir>/Browser/browser
var tbbBrowserDepth = 2; // Windows and Linux
var tbbBrowserDepth = 1; // Windows and Linux
if (TorLauncherUtil.isAppVersionAtLeast("21.0"))
{
// In FF21+, CurProcD is the "browser" directory that is next to
// the firefox binary, e.g., <TorFileBaseDir>/Browser/browser
++tbbBrowserDepth;
}
if (TorLauncherUtil.isMac)
tbbBrowserDepth += 4;
......
......@@ -26,6 +26,15 @@ let TorLauncherUtil = // Public
return ("WINNT" == TLUtilInternal._OS);
},
isAppVersionAtLeast: function(aVersion)
{
var appInfo = Cc["@mozilla.org/xre/app-info;1"]
.getService(Ci.nsIXULAppInfo);
var vc = Cc["@mozilla.org/xpcom/version-comparator;1"]
.getService(Ci.nsIVersionComparator);
return (vc.compare(appInfo.version, aVersion) >= 0);
},
// Error Reporting / Prompting
showAlert: function(aParentWindow, aMsg)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment