Pier Angelo Vendrame pushed to branch mullvad-browser-128.7.0esr-14.5-1 at The Tor Project / Applications / Mullvad Browser
Commits:
602d2c43 by Pier Angelo Vendrame at 2025-02-27T10:35:07+01:00
fixup! BB 32308: Use direct browser sizing for letterboxing.
When the dimension is less than 50px, we need to return dimension
itself, rather than a 0px margin.
- - - - -
535e2267 by Pier Angelo Vendrame at 2025-02-27T10:35:09+01:00
fixup! BB 41631: Prevent weird initial window dimensions caused by subpixel computations
BB 43205: Fix newwin rounding.
RFP might produce bad rounding because of platform-specific bugs.
Solving them might involve a refactor that is out of our capacity,
therefore we add a JS patch to fix wrong sizes.
- - - - -
46d99e57 by Pier Angelo Vendrame at 2025-02-27T10:35:09+01:00
fixup! BB 41918: Option to reuse last window size when letterboxing is enabled.
BB 43205: Fix newwin rounding.
Do not fix sizes when remember last size is enabled.
- - - - -
1 changed file:
- toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
Changes:
=====================================
toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
=====================================
@@ -4,6 +4,7 @@
* You can obtain one at https://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
+import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import * as constants from "resource://gre/modules/RFPTargetConstants.sys.mjs";
const kPrefResistFingerprinting = "privacy.resistFingerprinting";
@@ -21,6 +22,8 @@ const kPrefLetterboxingGradient =
"privacy.resistFingerprinting.letterboxing.gradient";
const kPrefLetterboxingDidForceSize =
"privacy.resistFingerprinting.letterboxing.didForceSize";
+const kPrefLetterboxingRememberSize =
+ "privacy.resistFingerprinting.letterboxing.rememberSize";
const kTopicDOMWindowOpened = "domwindowopened";
@@ -519,22 +522,23 @@ class _RFPHelper {
}
}
+ stepping(aDimension, aIsWidth) {
+ if (aDimension <= 500) {
+ return 50;
+ } else if (aDimension <= 1600) {
+ return aIsWidth ? 200 : 100;
+ }
+ return 200;
+ }
+
/**
* Given a width or height, rounds it with the proper stepping.
*/
steppedSize(aDimension, aIsWidth = false) {
- let stepping;
if (aDimension <= 50) {
- return 0;
- } else if (aDimension <= 500) {
- stepping = 50;
- } else if (aDimension <= 1600) {
- stepping = aIsWidth ? 200 : 100;
- } else {
- stepping = 200;
+ return aDimension;
}
-
- return aDimension - (aDimension % stepping);
+ return aDimension - (aDimension % this.stepping(aDimension, aIsWidth));
}
/**
@@ -806,6 +810,7 @@ class _RFPHelper {
}
_attachWindow(aWindow) {
+ this._fixRounding(aWindow);
aWindow.addEventListener("sizemodechange", windowResizeHandler);
aWindow.shrinkToLetterbox = this.shrinkToLetterbox;
aWindow.addEventListener("dblclick", this._onWindowDoubleClick);
@@ -865,6 +870,52 @@ class _RFPHelper {
);
}
+ _fixRounding(aWindow) {
+ if (
+ !this.rfpEnabled ||
+ Services.prefs.getBoolPref(kPrefLetterboxingRememberSize, false)
+ ) {
+ return;
+ }
+
+ // tor-browser#43205: in case of subpixels, new windows might have a wrong
+ // size because of platform-specific bugs (e.g., Bug 1947439 on Windows).
+ const contentContainer = aWindow.document.getElementById("browser");
+ const rect = contentContainer.getBoundingClientRect();
+ const steppingWidth = this.stepping(rect.width, true);
+ const steppingHeight = this.stepping(rect.height, false);
+ const deltaWidth =
+ rect.width - steppingWidth * Math.round(rect.width / steppingWidth);
+ const deltaHeight =
+ rect.height - steppingHeight * Math.round(rect.height / steppingHeight);
+
+ // It seems that under X11, a window cannot have all the possible (integer)
+ // sizes (see the videos on tor-browser#43205 and Bug 1947439)...
+ // We observed this behavior with 1.25 scaling, but we could not find
+ // where it happens exactly, so this code might be wrong.
+ // On the same system, this problem does not happen with Wayland.
+ if (AppConstants.platform === "linux") {
+ let targetWidth = aWindow.outerWidth - deltaWidth;
+ let targetHeight = aWindow.outerHeight - deltaHeight;
+ const x11Size = s =>
+ Math.floor(
+ // This first rounding is done by Gecko, rather than X11.
+ Math.round(s * aWindow.devicePixelRatio) / aWindow.devicePixelRatio
+ );
+ const x11Width = x11Size(targetWidth);
+ const x11Height = x11Size(targetHeight);
+ if (x11Width < targetWidth) {
+ targetWidth = x11Width + 2;
+ }
+ if (x11Height < targetHeight) {
+ targetHeight = x11Height + 2;
+ }
+ aWindow.resizeTo(targetWidth, targetHeight);
+ } else {
+ aWindow.resizeBy(deltaWidth, deltaHeight);
+ }
+ }
+
getTargets() {
return constants.Targets;
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/21…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/21…
You're receiving this email because of your account on gitlab.torproject.org.
Pier Angelo Vendrame pushed to branch tor-browser-128.7.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits:
231eebe7 by Pier Angelo Vendrame at 2025-02-27T10:28:06+01:00
fixup! BB 32308: Use direct browser sizing for letterboxing.
When the dimension is less than 50px, we need to return dimension
itself, rather than a 0px margin.
- - - - -
410e75f5 by Pier Angelo Vendrame at 2025-02-27T10:28:12+01:00
fixup! BB 41631: Prevent weird initial window dimensions caused by subpixel computations
BB 43205: Fix newwin rounding.
RFP might produce bad rounding because of platform-specific bugs.
Solving them might involve a refactor that is out of our capacity,
therefore we add a JS patch to fix wrong sizes.
- - - - -
85e00bd3 by Pier Angelo Vendrame at 2025-02-27T10:28:13+01:00
fixup! BB 41918: Option to reuse last window size when letterboxing is enabled.
BB 43205: Fix newwin rounding.
Do not fix sizes when remember last size is enabled.
- - - - -
1 changed file:
- toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
Changes:
=====================================
toolkit/components/resistfingerprinting/RFPHelper.sys.mjs
=====================================
@@ -4,6 +4,7 @@
* You can obtain one at https://mozilla.org/MPL/2.0/. */
import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
+import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs";
import * as constants from "resource://gre/modules/RFPTargetConstants.sys.mjs";
const kPrefResistFingerprinting = "privacy.resistFingerprinting";
@@ -21,6 +22,8 @@ const kPrefLetterboxingGradient =
"privacy.resistFingerprinting.letterboxing.gradient";
const kPrefLetterboxingDidForceSize =
"privacy.resistFingerprinting.letterboxing.didForceSize";
+const kPrefLetterboxingRememberSize =
+ "privacy.resistFingerprinting.letterboxing.rememberSize";
const kTopicDOMWindowOpened = "domwindowopened";
@@ -519,22 +522,23 @@ class _RFPHelper {
}
}
+ stepping(aDimension, aIsWidth) {
+ if (aDimension <= 500) {
+ return 50;
+ } else if (aDimension <= 1600) {
+ return aIsWidth ? 200 : 100;
+ }
+ return 200;
+ }
+
/**
* Given a width or height, rounds it with the proper stepping.
*/
steppedSize(aDimension, aIsWidth = false) {
- let stepping;
if (aDimension <= 50) {
- return 0;
- } else if (aDimension <= 500) {
- stepping = 50;
- } else if (aDimension <= 1600) {
- stepping = aIsWidth ? 200 : 100;
- } else {
- stepping = 200;
+ return aDimension;
}
-
- return aDimension - (aDimension % stepping);
+ return aDimension - (aDimension % this.stepping(aDimension, aIsWidth));
}
/**
@@ -806,6 +810,7 @@ class _RFPHelper {
}
_attachWindow(aWindow) {
+ this._fixRounding(aWindow);
aWindow.addEventListener("sizemodechange", windowResizeHandler);
aWindow.shrinkToLetterbox = this.shrinkToLetterbox;
aWindow.addEventListener("dblclick", this._onWindowDoubleClick);
@@ -865,6 +870,52 @@ class _RFPHelper {
);
}
+ _fixRounding(aWindow) {
+ if (
+ !this.rfpEnabled ||
+ Services.prefs.getBoolPref(kPrefLetterboxingRememberSize, false)
+ ) {
+ return;
+ }
+
+ // tor-browser#43205: in case of subpixels, new windows might have a wrong
+ // size because of platform-specific bugs (e.g., Bug 1947439 on Windows).
+ const contentContainer = aWindow.document.getElementById("browser");
+ const rect = contentContainer.getBoundingClientRect();
+ const steppingWidth = this.stepping(rect.width, true);
+ const steppingHeight = this.stepping(rect.height, false);
+ const deltaWidth =
+ rect.width - steppingWidth * Math.round(rect.width / steppingWidth);
+ const deltaHeight =
+ rect.height - steppingHeight * Math.round(rect.height / steppingHeight);
+
+ // It seems that under X11, a window cannot have all the possible (integer)
+ // sizes (see the videos on tor-browser#43205 and Bug 1947439)...
+ // We observed this behavior with 1.25 scaling, but we could not find
+ // where it happens exactly, so this code might be wrong.
+ // On the same system, this problem does not happen with Wayland.
+ if (AppConstants.platform === "linux") {
+ let targetWidth = aWindow.outerWidth - deltaWidth;
+ let targetHeight = aWindow.outerHeight - deltaHeight;
+ const x11Size = s =>
+ Math.floor(
+ // This first rounding is done by Gecko, rather than X11.
+ Math.round(s * aWindow.devicePixelRatio) / aWindow.devicePixelRatio
+ );
+ const x11Width = x11Size(targetWidth);
+ const x11Height = x11Size(targetHeight);
+ if (x11Width < targetWidth) {
+ targetWidth = x11Width + 2;
+ }
+ if (x11Height < targetHeight) {
+ targetHeight = x11Height + 2;
+ }
+ aWindow.resizeTo(targetWidth, targetHeight);
+ } else {
+ aWindow.resizeBy(deltaWidth, deltaHeight);
+ }
+ }
+
getTargets() {
return constants.Targets;
}
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/797f4e…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/797f4e…
You're receiving this email because of your account on gitlab.torproject.org.
Dan Ballard pushed to branch tor-browser-128.7.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits:
8db5a552 by clairehurst at 2025-02-27T01:14:52+00:00
fixup! [android] Implement Android-native Connection Assist UI
This should have been included with the following.
Bug 43359: Improper handling of TorBootstrapChangeListener with respect to system onDestroy() calls for HomeActivity
- - - - -
1 changed file:
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
Changes:
=====================================
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
=====================================
@@ -452,10 +452,12 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorAn
components.notificationsDelegate.bindToActivity(this)
- val engine = components.core.engine
- if (engine is GeckoEngine) {
- val torIntegration = engine.getTorIntegrationController()
- torIntegration.registerBootstrapStateChangeListener(this)
+ if (settings().useHtmlConnectionUi) {
+ val engine = components.core.engine
+ if (engine is GeckoEngine) {
+ val torIntegration = engine.getTorIntegrationController()
+ torIntegration.registerBootstrapStateChangeListener(this)
+ }
}
StartupTimeline.onActivityCreateEndHome(this) // DO NOT MOVE ANYTHING BELOW HERE.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/8db5a55…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/8db5a55…
You're receiving this email because of your account on gitlab.torproject.org.
ma1 pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
15ee5d47 by hackademix at 2025-02-26T19:31:28+01:00
Bug 41381: More flexible tagging script.
- - - - -
2 changed files:
- tools/browser/README.md
- tools/browser/sign-tag
Changes:
=====================================
tools/browser/README.md
=====================================
@@ -37,11 +37,11 @@ This script gpg signs a git tag associated with a particular browser commit in t
#### Prerequisites
-- The user must create the following soft-links:
+- The user may create the following soft-links (by default they are automatically pointed to ../../git_clones/firefox):
- `/tools/browser/basebrowser` -> `/path/to/local/tor-browser.git`
- `/tools/browser/mullvadbrowser` -> `/path/to/local/mullvad-browser.git`
- `/tools/browser/torbrowser` -> `/path/to/local/tor-browser.git`
-- The user must first checkout the relevant branch of the commit we are tagging
+- The user must first checkout the relevant branch (local or remote-tracking) of the commit we are tagging
- This is needed to extract the ESR version, branch-number, and browser name
#### Usage
@@ -93,4 +93,4 @@ Invoke the relevant soft-link'd version of this script to sign a particular brow
Tag commit 385aa0559a90 in mullvad-browser-128.4.0esr-14.0-1
tag: mullvad-browser-128.4.0esr-14.0-1-build2
message: Tagging build2 for 128.4.0esr-based stable
- ```
\ No newline at end of file
+ ```
=====================================
tools/browser/sign-tag
=====================================
@@ -18,7 +18,9 @@ browser=$(echo "$script_name" | perl -pe 's/^[^\.]+\.//')
case "${browser}" in
basebrowser | torbrowser | mullvadbrowser)
# go down to browser directory
- pushd ${script_dir}/${browser} > /dev/null
+ browser_dir="$script_dir/$browser"
+ [ -e "$browser_dir" ] || ln -s "../../git_clones/firefox" "$browser_dir"
+ pushd "$browser_dir" > /dev/null
# and exit on script termination
trap "popd > /dev/null" EXIT
;;
@@ -33,7 +35,7 @@ esac
# and message
#
-branch_name=$(git rev-parse --abbrev-ref HEAD)
+branch_name=$(git log -n1 --oneline --decorate=short | grep -Eo '[a-z]+-browser-[1-9][0-9]+[^),]*-[1-9]' | head -n1)
if [[ $branch_name =~ ^([a-z]+-browser)-([1-9][0-9]+\.[0-9]+)(\.[0-9]+esr|a[1-9][0-9]*)-([1-9][0-9]*\.[05])-([1-9]).*$ ]]; then
project="${BASH_REMATCH[1]}"
upstream="${BASH_REMATCH[2]}${BASH_REMATCH[3]}"
@@ -77,8 +79,10 @@ commit=$(git rev-parse --short ${3:-HEAD})
# channel validation
if [[ "${project}" == "mullvad-browser" ]]; then
+ repo="$project"
valid_channels=("rapid" "alpha" "stable")
else
+ repo="tor-browser"
valid_channels=("rapid" "alpha" "stable" "legacy")
fi
channel_valid=false
@@ -113,3 +117,9 @@ echo " tag: ${tag}"
echo " message: ${message}"
git tag -s "${tag}" "${commit}" -m "${message}"
+
+read -p "Do you want to push ${tag} to ${repo}.git? (y/N) " -n 1 -r
+echo
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ git push "git@gitlab.torproject.org:tpo/applications/${repo}.git" "${tag}"
+fi
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/1…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/1…
You're receiving this email because of your account on gitlab.torproject.org.