Richard Pospesel pushed to branch tor-browser-102.6.0esr-12.0-1 at The Tor Project / Applications / Tor Browser
Commits:
be0f1dcb by Henry Wilkes at 2023-01-11T17:22:14+00:00
fixup! Bug 40209: Implement Basic Crypto Safety
Bug 41539: Remove all whitespace from copied text before testing if it
looks like a crypto address.
(cherry picked from commit 221b7a494351e853bae3aa4878573829e7f7015a)
- - - - -
1 changed file:
- browser/actors/CryptoSafetyChild.jsm
Changes:
=====================================
browser/actors/CryptoSafetyChild.jsm
=====================================
@@ -74,7 +74,7 @@ class CryptoSafetyChild extends JSWindowActorChild {
if (event.type == "copy" || event.type == "cut") {
this.contentWindow.navigator.clipboard.readText().then(clipText => {
- const selection = clipText.trim();
+ const selection = clipText.replace(/\s+/g, "");
if (looksLikeCryptoAddress(selection)) {
this.sendAsyncMessage("CryptoSafety:CopiedText", {
selection,
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/be0f1dc…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/be0f1dc…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
84e066a2 by hackademix at 2023-01-11T11:10:14+01:00
fixup! Bug 32308: use direct browser sizing for letterboxing.
Bug 41560: fix turning off letterboxing causes content not rendering in the current window.
- - - - -
2 changed files:
- browser/base/content/browser.css
- toolkit/components/resistfingerprinting/RFPHelper.jsm
Changes:
=====================================
browser/base/content/browser.css
=====================================
@@ -111,7 +111,7 @@ body {
outline: initial;
}
-:root:not([inDOMFullscreen]) .letterboxing-ready .browserStack:not(.exclude-letterboxing) {
+:root:not([inDOMFullscreen]) .letterboxing.letterboxing-ready .browserStack:not(.exclude-letterboxing) {
place-content: start center;
}
=====================================
toolkit/components/resistfingerprinting/RFPHelper.jsm
=====================================
@@ -601,7 +601,7 @@ class _RFPHelper {
_detachWindow(aWindow) {
let tabBrowser = aWindow.gBrowser;
tabBrowser.removeTabsProgressListener(this);
- aWindow._rfpResizeObserver.disconnect();
+ aWindow._rfpResizeObserver?.disconnect();
delete aWindow._rfpResizeObserver;
aWindow.removeEventListener("TabOpen", this);
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/84e066a…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/84e066a…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
60e9699e by Pier Angelo Vendrame at 2023-01-11T09:26:34+00:00
fixup! TB3: Tor Browser's official .mozconfigs.
Bug 41567: Do not customize MOZ_APP_BASENAME in Tor Browser.
That variable renames a lot of "firefox"es to "torbrowser".
It could be desirable, but it will break a lot of legacy, including
links generated with the Windows installer.
- - - - -
1 changed file:
- browser/config/mozconfigs/tor-browser
Changes:
=====================================
browser/config/mozconfigs/tor-browser
=====================================
@@ -1,6 +1,5 @@
. $topsrcdir/browser/config/mozconfigs/base-browser
-export MOZ_APP_BASENAME="TorBrowser"
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
ac_add_options --with-relative-data-dir=TorBrowser/Data/Browser
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/60e9699…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/60e9699…
You're receiving this email because of your account on gitlab.torproject.org.
Richard Pospesel pushed to branch base-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
cc5f2fcd by Pier Angelo Vendrame at 2023-01-10T19:59:42+00:00
fixup! Bug 9173: Change the default Firefox profile directory to be relative.
Bug 20497: Make it possible to disable portable mode
9173 is the patch that enables portable mode for Tor Browser.
We modified it to make it optional, but it still used to remove a few
important parts that made it compulsory to define a profile directory
in the application.ini (through the mozconfig).
This commit restores these parts, and makes it hopefully possible to
disable portable mode without filling the home directory with TBB
files.
A few parts are then disabled in a following commit, since they are
TBB-legacy behavior, but we might not want them for base-browser and
for privacy-browser.
Also, this commit changes the configure flag from
--with-relative-profile-directory to --with-relative-data-dir, because
the data directories can contain the profile and the local data such as
caches, not only the profile.
Still, we are assuming we are using the same data directory for the
profile and for the caches, which is not the case on Windows (where the
profile is roaming, and the caches are local) and on Linux (where the
profile is in the home, and the cache is in ~/.cache).
- - - - -
5 changed files:
- browser/config/mozconfigs/base-browser
- moz.configure
- mozconfig-macos-x86_64
- toolkit/xre/nsXREDirProvider.cpp
- xpcom/io/nsAppFileLocationProvider.cpp
Changes:
=====================================
browser/config/mozconfigs/base-browser
=====================================
@@ -42,4 +42,4 @@ if test -z "$WASI_SYSROOT"; then
ac_add_options --without-wasm-sandboxed-libraries
fi
-ac_add_options --with-relative-profile=BaseBrowser/Data/Browser
+ac_add_options --with-relative-data-dir=BaseBrowser/Data/Browser
=====================================
moz.configure
=====================================
@@ -1026,22 +1026,22 @@ set_define("BASE_BROWSER", True, when="--enable-base-browser")
option(
- "--with-relative-profile",
+ "--with-relative-data-dir",
nargs=1,
- help="Sets the directory of the profile, relative to the application directory"
+ help="Sets the data directories to be relative to the application directory"
)
-@depends("--with-relative-profile", target)
+@depends("--with-relative-data-dir", target)
@imports("json")
-def relative_profile(value, target):
+def relative_data_dir(value, target):
if value and target.os == "Android":
- die("--with-relative-profile is not supported on Android")
+ die("--with-relative-data-dir is not supported on Android")
if value:
return json.dumps(value[0])
-set_define("RELATIVE_PROFILE_DIRECTORY", relative_profile)
+set_define("RELATIVE_DATA_DIR", relative_data_dir)
# Please do not add configure checks from here on.
=====================================
mozconfig-macos-x86_64
=====================================
@@ -4,3 +4,6 @@ ac_add_options --enable-strip
# See bug #41131
ac_add_options --disable-update-agent
+
+# For base-browser we do not enable portable mode on macOS.
+ac_add_options --without-relative-data-dir
=====================================
toolkit/xre/nsXREDirProvider.cpp
=====================================
@@ -234,6 +234,9 @@ nsresult nsXREDirProvider::GetUserProfilesRootDir(nsIFile** aResult) {
nsresult rv = GetUserDataDirectory(getter_AddRefs(file), false);
if (NS_SUCCEEDED(rv)) {
+#if !defined(XP_UNIX) || defined(XP_MACOSX)
+ rv = file->AppendNative("Profiles"_ns);
+#endif
// We must create the profile directory here if it does not exist.
nsresult tmp = EnsureDirectoryExists(file);
if (NS_FAILED(tmp)) {
@@ -249,6 +252,9 @@ nsresult nsXREDirProvider::GetUserProfilesLocalDir(nsIFile** aResult) {
nsresult rv = GetUserDataDirectory(getter_AddRefs(file), true);
if (NS_SUCCEEDED(rv)) {
+#if !defined(XP_UNIX) || defined(XP_MACOSX)
+ rv = file->AppendNative("Profiles"_ns);
+#endif
// We must create the profile directory here if it does not exist.
nsresult tmp = EnsureDirectoryExists(file);
if (NS_FAILED(tmp)) {
@@ -1332,14 +1338,14 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
return gDataDirHome->Clone(aFile);
}
-#if defined(RELATIVE_PROFILE_DIRECTORY)
+#if defined(RELATIVE_DATA_DIR)
RefPtr<nsXREDirProvider> singleton = GetSingleton();
if (!singleton) {
return NS_ERROR_OUT_OF_MEMORY;
}
rv = singleton->GetAppRootDir(getter_AddRefs(localDir));
NS_ENSURE_SUCCESS(rv, rv);
- nsAutoCString profileDir(RELATIVE_PROFILE_DIRECTORY);
+ nsAutoCString profileDir(RELATIVE_DATA_DIR);
rv = localDir->SetRelativePath(localDir.get(), profileDir);
NS_ENSURE_SUCCESS(rv, rv);
if (aLocal) {
@@ -1502,7 +1508,7 @@ nsresult nsXREDirProvider::GetAppRootDir(nsIFile** aFile) {
#endif
while (levelsToRemove-- > 0) {
rv = file->GetParent(getter_AddRefs(appRootDir));
- NS_ENSURE_SUCCESS(rv, rv);
+ NS_ENSURE_SUCCESS(rv, rv);
file = appRootDir;
}
return appRootDir->Clone(aFile);
@@ -1559,8 +1565,13 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
}
nsAutoCString profile;
+ nsAutoCString appName;
+ nsAutoCString vendor;
if (gAppData->profile) {
profile = gAppData->profile;
+ } else {
+ appName = gAppData->name;
+ vendor = gAppData->vendor;
}
nsresult rv = NS_OK;
@@ -1568,12 +1579,27 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
#if defined(XP_MACOSX)
if (!profile.IsEmpty()) {
rv = AppendProfileString(aFile, profile.get());
+# ifndef RELATIVE_DATA_DIR
+ } else {
+ // Note that MacOS ignores the vendor when creating the profile hierarchy -
+ // all application preferences directories live alongside one another in
+ // ~/Library/Application Support/
+ rv = aFile->AppendNative(appName);
+# endif
}
NS_ENSURE_SUCCESS(rv, rv);
#elif defined(XP_WIN)
if (!profile.IsEmpty()) {
rv = AppendProfileString(aFile, profile.get());
+# ifndef RELATIVE_DATA_DIR
+ } else {
+ if (!vendor.IsEmpty()) {
+ rv = aFile->AppendNative(vendor);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
+ rv = aFile->AppendNative(appName);
+# endif
}
NS_ENSURE_SUCCESS(rv, rv);
@@ -1585,21 +1611,48 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
rv = aFile->AppendNative(nsDependentCString("mozilla"));
NS_ENSURE_SUCCESS(rv, rv);
#elif defined(XP_UNIX)
+ nsAutoCString folder;
+ // Make it hidden (by starting with "."), except when local (the
+ // profile is already under ~/.cache or XDG_CACHE_HOME).
+# ifndef RELATIVE_DATA_DIR
+ if (!aLocal) folder.Assign('.');
+# endif
+
if (!profile.IsEmpty()) {
// Skip any leading path characters
const char* profileStart = profile.get();
while (*profileStart == '/' || *profileStart == '\\') profileStart++;
+# ifndef RELATIVE_DATA_DIR
// On the off chance that someone wanted their folder to be hidden don't
// let it become ".."
- if (*profileStart == '.') profileStart++;
+ if (*profileStart == '.' && !aLocal) profileStart++;
+# endif
- // Make it hidden (by starting with ".").
- nsAutoCString folder(".");
folder.Append(profileStart);
ToLowerCase(folder);
rv = AppendProfileString(aFile, folder.BeginReading());
+# ifndef RELATIVE_DATA_DIR
+ } else {
+ if (!vendor.IsEmpty()) {
+ folder.Append(vendor);
+ ToLowerCase(folder);
+
+ rv = aFile->AppendNative(folder);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ folder.Truncate();
+ }
+
+ // This can be the case in tests.
+ if (!appName.IsEmpty()) {
+ folder.Append(appName);
+ ToLowerCase(folder);
+
+ rv = aFile->AppendNative(folder);
+ }
+# endif
}
NS_ENSURE_SUCCESS(rv, rv);
=====================================
xpcom/io/nsAppFileLocationProvider.cpp
=====================================
@@ -247,7 +247,7 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
bool exists;
nsCOMPtr<nsIFile> localDir;
-#if defined(RELATIVE_PROFILE_DIRECTORY)
+#if defined(RELATIVE_DATA_DIR)
nsCOMPtr<nsIProperties> directoryService(
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
@@ -260,9 +260,9 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
rv = file->Normalize();
NS_ENSURE_SUCCESS(rv, rv);
int levelsToRemove = 1;
-#if defined(XP_MACOSX)
+# if defined(XP_MACOSX)
levelsToRemove += 2;
-#endif
+# endif
while (levelsToRemove-- > 0) {
rv = file->GetParent(getter_AddRefs(appRootDir));
NS_ENSURE_SUCCESS(rv, rv);
@@ -270,7 +270,7 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
}
localDir = appRootDir;
- nsAutoCString profileDir(RELATIVE_PROFILE_DIRECTORY);
+ nsAutoCString profileDir(RELATIVE_DATA_DIR);
rv = localDir->SetRelativePath(localDir.get(), profileDir);
NS_ENSURE_SUCCESS(rv, rv);
@@ -318,6 +318,12 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
# error dont_know_how_to_get_product_dir_on_your_platform
#endif
+#if !defined(RELATIVE_DATA_DIR)
+ rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+#endif
rv = localDir->Exists(&exists);
if (NS_SUCCEEDED(rv) && !exists) {
@@ -351,6 +357,23 @@ nsresult nsAppFileLocationProvider::GetDefaultUserProfileRoot(
return rv;
}
+#if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN)
+ // These 3 platforms share this part of the path - do them as one
+ rv = localDir->AppendRelativeNativePath("Profiles"_ns);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ bool exists;
+ rv = localDir->Exists(&exists);
+ if (NS_SUCCEEDED(rv) && !exists) {
+ rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0775);
+ }
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+#endif
+
localDir.forget(aLocalFile);
return rv;
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cc5f2fc…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/cc5f2fc…
You're receiving this email because of your account on gitlab.torproject.org.
Richard Pospesel pushed to branch tor-browser-102.6.0esr-12.0-1 at The Tor Project / Applications / Tor Browser
Commits:
dca7ddb7 by Pier Angelo Vendrame at 2023-01-10T19:18:47+00:00
fixup! Bug 40933: Add tor-launcher functionality
Bug 41549: Correctly handle tor's stdout
Subprocess.jsm manages stdout through a pipe, which we never emptied.
As a result, it tor filled it completely, a lot of other stuff stalled.
The previous implementation dumped tor's stdout to the browser's one,
so this commit restores this behavior.
(cherry picked from commit c20e9ad7c04325c67c7259d7bf69a7ff3e160466)
- - - - -
1 changed file:
- toolkit/components/tor-launcher/TorProcess.jsm
Changes:
=====================================
toolkit/components/tor-launcher/TorProcess.jsm
=====================================
@@ -133,9 +133,10 @@ class TorProcess {
arguments: this._args,
environment,
environmentAppend: true,
- stderr: "pipe",
+ stderr: "stdout",
};
this._subprocess = await Subprocess.call(options);
+ this._dumpStdout();
this._watchProcess();
this._status = TorProcessStatus.Running;
this._torProcessStartTime = Date.now();
@@ -173,6 +174,16 @@ class TorProcess {
this._didConnectToTorControlPort = true;
}
+ async _dumpStdout() {
+ let string;
+ while (
+ this._subprocess &&
+ (string = await this._subprocess.stdout.readString())
+ ) {
+ dump(string);
+ }
+ }
+
async _watchProcess() {
const watched = this._subprocess;
if (!watched) {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dca7ddb…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dca7ddb…
You're receiving this email because of your account on gitlab.torproject.org.
Richard Pospesel pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
c20e9ad7 by Pier Angelo Vendrame at 2023-01-10T19:17:03+00:00
fixup! Bug 40933: Add tor-launcher functionality
Bug 41549: Correctly handle tor's stdout
Subprocess.jsm manages stdout through a pipe, which we never emptied.
As a result, it tor filled it completely, a lot of other stuff stalled.
The previous implementation dumped tor's stdout to the browser's one,
so this commit restores this behavior.
- - - - -
1 changed file:
- toolkit/components/tor-launcher/TorProcess.jsm
Changes:
=====================================
toolkit/components/tor-launcher/TorProcess.jsm
=====================================
@@ -133,9 +133,10 @@ class TorProcess {
arguments: this._args,
environment,
environmentAppend: true,
- stderr: "pipe",
+ stderr: "stdout",
};
this._subprocess = await Subprocess.call(options);
+ this._dumpStdout();
this._watchProcess();
this._status = TorProcessStatus.Running;
this._torProcessStartTime = Date.now();
@@ -173,6 +174,16 @@ class TorProcess {
this._didConnectToTorControlPort = true;
}
+ async _dumpStdout() {
+ let string;
+ while (
+ this._subprocess &&
+ (string = await this._subprocess.stdout.readString())
+ ) {
+ dump(string);
+ }
+ }
+
async _watchProcess() {
const watched = this._subprocess;
if (!watched) {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c20e9ad…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c20e9ad…
You're receiving this email because of your account on gitlab.torproject.org.
Richard Pospesel pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
5858c308 by Pier Angelo Vendrame at 2023-01-10T18:10:55+01:00
dropme! Partial revert of Bug 13252
I need to modify Bug 9173. So, I am removing a few changes from 13252
to make both the modifications and the rebase easier.
- - - - -
acdcfcae by Pier Angelo Vendrame at 2023-01-10T18:11:04+01:00
fixup! Bug 2176: Rebrand Firefox to TorBrowser
This commit adds TorProject as the vendor of Tor Browser.
This should be visible both in the Windows binaries, and will be used
to create the profile directory if we disable the portable mode.
- - - - -
5c5e44d0 by Pier Angelo Vendrame at 2023-01-10T18:13:36+01:00
fixup! Bug 9173: Change the default Firefox profile directory to be relative.
Bug 20497: Make it possible to disable portable mode
9173 is the patch that enables portable mode for Tor Browser.
We modified it to make it optional, but it still used to remove a few
important parts that made it compulsory to define a profile directory
in the application.ini (through the mozconfig).
This commit restores these parts, and makes it hopefully possible to
disable portable mode without filling the home directory with TBB
files.
A few parts are then disabled in a following commit, since they are
TBB-legacy behavior, but we might not want them for base-browser and
for privacy-browser.
Also, this commit changes the configure flag from
--with-relative-profile-directory to --with-relative-data-dir, because
the data directories can contain the profile and the local data such as
caches, not only the profile.
Still, we are assuming we are using the same data directory for the
profile and for the caches, which is not the case on Windows (where the
profile is roaming, and the caches are local) and on Linux (where the
profile is in the home, and the cache is in ~/.cache).
- - - - -
458fbecf by Pier Angelo Vendrame at 2023-01-10T18:13:44+01:00
fixup! TB3: Tor Browser's official .mozconfigs.
Change relative-profile-directory with relative-data-dir.
- - - - -
a958edce by Pier Angelo Vendrame at 2023-01-10T18:13:45+01:00
fixup! Bug 13252: Do not store data in the app bundle
Bug 20497: Make it possible to use Tor Browser in non-portable mode
Add back some legacy Tor Browser-specific behaviors that we restored in
9173.
Bug 41535: Remove the old, unused and undocumented "-invisible" macOS CLI flag
- - - - -
6 changed files:
- browser/config/mozconfigs/tor-browser
- browser/confvars.sh
- moz.configure
- toolkit/xre/nsAppRunner.cpp
- toolkit/xre/nsXREDirProvider.cpp
- xpcom/io/nsAppFileLocationProvider.cpp
Changes:
=====================================
browser/config/mozconfigs/tor-browser
=====================================
@@ -1,8 +1,15 @@
. $topsrcdir/browser/config/mozconfigs/base-browser
+export MOZ_APP_BASENAME="TorBrowser"
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
-ac_add_options --with-relative-profile=TorBrowser/Data/Browser
+ac_add_options --with-relative-data-dir=TorBrowser/Data/Browser
+# This is not needed with the relative data directory, but it is when you
+# disable it, otherwise it is "Mozilla" (on Windows and macOS) or ".mozilla" on
+# Unix systems.
+# It is used, for example, for GetProductDirectory.
+# ac_add_options --with-user-appdir=TorProject
+# ac_add_options --with-user-appdir=.torproject
ac_add_options --enable-tor-browser-update
ac_add_options --enable-verify-mar
=====================================
browser/confvars.sh
=====================================
@@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOZ_APP_VENDOR=Mozilla
+MOZ_APP_VENDOR="Tor Project"
BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml
=====================================
moz.configure
=====================================
@@ -1026,22 +1026,22 @@ set_define("BASE_BROWSER", True, when="--enable-base-browser")
option(
- "--with-relative-profile",
+ "--with-relative-data-dir",
nargs=1,
- help="Sets the directory of the profile, relative to the application directory"
+ help="Sets the data directories to be relative to the application directory"
)
-@depends("--with-relative-profile", target)
+@depends("--with-relative-data-dir", target)
@imports("json")
-def relative_profile(value, target):
+def relative_data_dir(value, target):
if value and target.os == "Android":
- die("--with-relative-profile is not supported on Android")
+ die("--with-relative-data-dir is not supported on Android")
if value:
return json.dumps(value[0])
-set_define("RELATIVE_PROFILE_DIRECTORY", relative_profile)
+set_define("RELATIVE_DATA_DIR", relative_data_dir)
# Tor additions.
=====================================
toolkit/xre/nsAppRunner.cpp
=====================================
@@ -4158,14 +4158,6 @@ int XREMain::XRE_mainInit(bool* aExitFlag) {
if (PR_GetEnv("XRE_MAIN_BREAK")) NS_BREAK();
#endif
-#if defined(XP_MACOSX) && defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
- bool hideDockIcon = (CheckArg("invisible") == ARG_FOUND);
- if (hideDockIcon) {
- ProcessSerialNumber psn = {0, kCurrentProcess};
- TransformProcessType(&psn, kProcessTransformToBackgroundApplication);
- }
-#endif
-
mozilla::startup::IncreaseDescriptorLimits();
#ifdef USE_GLX_TEST
@@ -5222,6 +5214,14 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) {
if (CheckArg("test-process-updates")) {
SaveToEnv("MOZ_TEST_PROCESS_UPDATES=1");
}
+# ifndef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
+ nsCOMPtr<nsIFile> exeFile, exeDir;
+ rv = mDirProvider.GetFile(XRE_EXECUTABLE_FILE, &persistent,
+ getter_AddRefs(exeFile));
+ NS_ENSURE_SUCCESS(rv, 1);
+ rv = exeFile->GetParent(getter_AddRefs(exeDir));
+# endif
+
# ifdef TOR_BROWSER_UPDATE
nsAutoCString compatVersion(TOR_BROWSER_VERSION_QUOTED);
# endif
=====================================
toolkit/xre/nsXREDirProvider.cpp
=====================================
@@ -236,6 +236,11 @@ nsresult nsXREDirProvider::GetUserProfilesRootDir(nsIFile** aResult) {
nsresult rv = GetUserDataDirectory(getter_AddRefs(file), false);
if (NS_SUCCEEDED(rv)) {
+ // For some reason, we have decided not to append "Profiles" in Tor Browser.
+ // So, let's keep removing it, or we should somehow migrate the profile.
+#if !defined(TOR_BROWSER_VERSION) && (!defined(XP_UNIX) || defined(XP_MACOSX))
+ rv = file->AppendNative("Profiles"_ns);
+#endif
// We must create the profile directory here if it does not exist.
nsresult tmp = EnsureDirectoryExists(file);
if (NS_FAILED(tmp)) {
@@ -251,6 +256,9 @@ nsresult nsXREDirProvider::GetUserProfilesLocalDir(nsIFile** aResult) {
nsresult rv = GetUserDataDirectory(getter_AddRefs(file), true);
if (NS_SUCCEEDED(rv)) {
+#if !defined(TOR_BROWSER_VERSION) && (!defined(XP_UNIX) || defined(XP_MACOSX))
+ rv = file->AppendNative("Profiles"_ns);
+#endif
// We must create the profile directory here if it does not exist.
nsresult tmp = EnsureDirectoryExists(file);
if (NS_FAILED(tmp)) {
@@ -1366,8 +1374,7 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
return gDataDirHome->Clone(aFile);
}
-#if defined(RELATIVE_PROFILE_DIRECTORY) || \
- defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+#if defined(RELATIVE_DATA_DIR) || defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
# ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
rv = GetTorBrowserUserDataDir(getter_AddRefs(localDir));
NS_ENSURE_SUCCESS(rv, rv);
@@ -1379,10 +1386,10 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
}
rv = singleton->GetAppRootDir(getter_AddRefs(localDir));
NS_ENSURE_SUCCESS(rv, rv);
- nsAutoCString profileDir(RELATIVE_PROFILE_DIRECTORY);
+ nsAutoCString profileDir(RELATIVE_DATA_DIR);
rv = localDir->SetRelativePath(localDir.get(), profileDir);
NS_ENSURE_SUCCESS(rv, rv);
-#endif
+# endif
if (aLocal) {
rv = localDir->AppendNative("Caches"_ns);
NS_ENSURE_SUCCESS(rv, rv);
@@ -1555,7 +1562,7 @@ nsresult nsXREDirProvider::GetAppRootDir(nsIFile** aFile) {
#endif
while (levelsToRemove-- > 0) {
rv = file->GetParent(getter_AddRefs(appRootDir));
- NS_ENSURE_SUCCESS(rv, rv);
+ NS_ENSURE_SUCCESS(rv, rv);
file = appRootDir;
}
return appRootDir->Clone(aFile);
@@ -1612,8 +1619,13 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
}
nsAutoCString profile;
+ nsAutoCString appName;
+ nsAutoCString vendor;
if (gAppData->profile) {
profile = gAppData->profile;
+ } else {
+ appName = gAppData->name;
+ vendor = gAppData->vendor;
}
nsresult rv = NS_OK;
@@ -1621,12 +1633,27 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
#if defined(XP_MACOSX)
if (!profile.IsEmpty()) {
rv = AppendProfileString(aFile, profile.get());
+# ifndef RELATIVE_DATA_DIR
+ } else {
+ // Note that MacOS ignores the vendor when creating the profile hierarchy -
+ // all application preferences directories live alongside one another in
+ // ~/Library/Application Support/
+ rv = aFile->AppendNative(appName);
+# endif
}
NS_ENSURE_SUCCESS(rv, rv);
#elif defined(XP_WIN)
if (!profile.IsEmpty()) {
rv = AppendProfileString(aFile, profile.get());
+# ifndef RELATIVE_DATA_DIR
+ } else {
+ if (!vendor.IsEmpty()) {
+ rv = aFile->AppendNative(vendor);
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
+ rv = aFile->AppendNative(appName);
+# endif
}
NS_ENSURE_SUCCESS(rv, rv);
@@ -1638,21 +1665,48 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
rv = aFile->AppendNative(nsDependentCString("mozilla"));
NS_ENSURE_SUCCESS(rv, rv);
#elif defined(XP_UNIX)
+ nsAutoCString folder;
+ // Make it hidden (by starting with "."), except when local (the
+ // profile is already under ~/.cache or XDG_CACHE_HOME).
+# ifndef RELATIVE_DATA_DIR
+ if (!aLocal) folder.Assign('.');
+# endif
+
if (!profile.IsEmpty()) {
// Skip any leading path characters
const char* profileStart = profile.get();
while (*profileStart == '/' || *profileStart == '\\') profileStart++;
+# ifndef RELATIVE_DATA_DIR
// On the off chance that someone wanted their folder to be hidden don't
// let it become ".."
- if (*profileStart == '.') profileStart++;
+ if (*profileStart == '.' && !aLocal) profileStart++;
+# endif
- // Make it hidden (by starting with ".").
- nsAutoCString folder(".");
folder.Append(profileStart);
ToLowerCase(folder);
rv = AppendProfileString(aFile, folder.BeginReading());
+# ifndef RELATIVE_DATA_DIR
+ } else {
+ if (!vendor.IsEmpty()) {
+ folder.Append(vendor);
+ ToLowerCase(folder);
+
+ rv = aFile->AppendNative(folder);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ folder.Truncate();
+ }
+
+ // This can be the case in tests.
+ if (!appName.IsEmpty()) {
+ folder.Append(appName);
+ ToLowerCase(folder);
+
+ rv = aFile->AppendNative(folder);
+ }
+# endif
}
NS_ENSURE_SUCCESS(rv, rv);
=====================================
xpcom/io/nsAppFileLocationProvider.cpp
=====================================
@@ -249,8 +249,7 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
bool exists;
nsCOMPtr<nsIFile> localDir;
-#if defined(RELATIVE_PROFILE_DIRECTORY) || \
- defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
+#if defined(RELATIVE_DATA_DIR) || defined(TOR_BROWSER_DATA_OUTSIDE_APP_DIR)
nsCOMPtr<nsIProperties> directoryService(
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
@@ -263,26 +262,24 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
rv = file->Normalize();
NS_ENSURE_SUCCESS(rv, rv);
int levelsToRemove = 1;
-#if defined(XP_MACOSX)
+# if defined(XP_MACOSX)
levelsToRemove += 2;
-#endif
+# endif
while (levelsToRemove-- > 0) {
rv = file->GetParent(getter_AddRefs(appRootDir));
NS_ENSURE_SUCCESS(rv, rv);
file = appRootDir;
}
-#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
+# ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
rv = TorBrowser_GetUserDataDir(appRootDir, getter_AddRefs(localDir));
NS_ENSURE_SUCCESS(rv, rv);
rv = localDir->AppendNative("Browser"_ns);
-#else
+# else
localDir = appRootDir;
- nsAutoCString profileDir(RELATIVE_PROFILE_DIRECTORY);
+ nsAutoCString profileDir(RELATIVE_DATA_DIR);
rv = localDir->SetRelativePath(localDir.get(), profileDir);
- NS_ENSURE_SUCCESS(rv, rv);
-#endif
-
+# endif
NS_ENSURE_SUCCESS(rv, rv);
if (aLocal) {
@@ -329,6 +326,12 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
# error dont_know_how_to_get_product_dir_on_your_platform
#endif
+#if !defined(RELATIVE_DATA_DIR) && !defined(TOR_BROWSER_VERSION)
+ rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+#endif
rv = localDir->Exists(&exists);
if (NS_SUCCEEDED(rv) && !exists) {
@@ -362,6 +365,26 @@ nsresult nsAppFileLocationProvider::GetDefaultUserProfileRoot(
return rv;
}
+#if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN)
+ // These 3 platforms share this part of the path - do them as one
+# ifndef TOR_BROWSER_VERSION
+ // Legacy: we do not use "Profiles" on Tor Browser.
+ rv = localDir->AppendRelativeNativePath("Profiles"_ns);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+# endif
+
+ bool exists;
+ rv = localDir->Exists(&exists);
+ if (NS_SUCCEEDED(rv) && !exists) {
+ rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0775);
+ }
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+#endif
+
localDir.forget(aLocalFile);
return rv;
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/060e2d…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/060e2d…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
060e2d72 by Pier Angelo Vendrame at 2023-01-10T16:38:50+00:00
fixup! Add TorStrings module for localization
Bug 41563: Fix old placeholders in TorStrings.jsm
- - - - -
1 changed file:
- browser/modules/TorStrings.jsm
Changes:
=====================================
browser/modules/TorStrings.jsm
=====================================
@@ -137,7 +137,7 @@ const Loader = {
bridgeCurrent: "Your Current Bridges",
bridgeCurrentDescription:
"You can keep one or more bridges saved, and Tor will choose which one to use when you connect. Tor will automatically switch to use another bridge when needed.",
- bridgeId: "#1 bridge: #2",
+ bridgeId: "%1$S bridge: %2$S",
remove: "Remove",
bridgeDisableBuiltIn: "Disable built-in bridges",
bridgeShare:
@@ -247,16 +247,16 @@ const Loader = {
couldNotConnect: "Tor Browser could not connect to Tor",
configureConnection: "configure your connection",
assistDescription:
- "If Tor is blocked in your location, trying a bridge may help. Connection assist can choose one for you using your location, or you can #1 manually instead.",
+ "If Tor is blocked in your location, trying a bridge may help. Connection assist can choose one for you using your location, or you can %S manually instead.",
tryingBridge: "Trying a bridge…",
tryingBridgeAgain: "Trying one more time…",
errorLocation: "Tor Browser couldn’t locate you",
errorLocationDescription:
- "Tor Browser needs to know your location in order to choose the right bridge for you. If you’d rather not share your location, #1 manually instead.",
+ "Tor Browser needs to know your location in order to choose the right bridge for you. If you’d rather not share your location, %S manually instead.",
isLocationCorrect: "Are these location settings correct?",
isLocationCorrectDescription:
- "Tor Browser still couldn’t connect to Tor. Please check your location settings are correct and try again, or #1 instead.",
+ "Tor Browser still couldn’t connect to Tor. Please check your location settings are correct and try again, or %S instead.",
finalError: "Tor Browser still cannot connect",
finalErrorDescription:
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/060e2d7…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/060e2d7…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits:
221b7a49 by Henry Wilkes at 2023-01-10T10:21:09+00:00
fixup! Bug 40209: Implement Basic Crypto Safety
Bug 41539: Remove all whitespace from copied text before testing if it
looks like a crypto address.
- - - - -
1 changed file:
- browser/actors/CryptoSafetyChild.jsm
Changes:
=====================================
browser/actors/CryptoSafetyChild.jsm
=====================================
@@ -74,7 +74,7 @@ class CryptoSafetyChild extends JSWindowActorChild {
if (event.type == "copy" || event.type == "cut") {
this.contentWindow.navigator.clipboard.readText().then(clipText => {
- const selection = clipText.trim();
+ const selection = clipText.replace(/\s+/g, "");
if (looksLikeCryptoAddress(selection)) {
this.sendAsyncMessage("CryptoSafety:CopiedText", {
selection,
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/221b7a4…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/221b7a4…
You're receiving this email because of your account on gitlab.torproject.org.