tor-commits
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 215585 discussions
[Git][tpo/applications/tor-browser-build][main] Bug 41693: Drop base-browser targets
by boklm (@boklm) 16 Feb '26
by boklm (@boklm) 16 Feb '26
16 Feb '26
boklm pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
a09a86d2 by Nicolas Vigier at 2026-02-12T19:46:23+01:00
Bug 41693: Drop base-browser targets
- - - - -
13 changed files:
- .gitignore
- Makefile
- README
- doc/MAKEFILE.txt
- projects/browser/config
- projects/browser/windows-installer/defines.nsh.in
- projects/firefox/build
- projects/firefox/config
- projects/go/config
- projects/linux-packages/config
- projects/release/config
- rbm.conf
- tools/signing/set-config
Changes:
=====================================
.gitignore
=====================================
@@ -3,7 +3,6 @@
/gclient
/out
/torbrowser
-/basebrowser
/mullvadbrowser
/testbuild
/rbm.local.conf
=====================================
Makefile
=====================================
@@ -236,154 +236,6 @@ torbrowser-compare-mar-signed-unsigned-alpha: submodule-update
$(rbm) build release --step compare_mar_signed_unsigned --target alpha --target signed --target torbrowser
-########################
-# Base Browser Targets #
-########################
-
-basebrowser-release: submodule-update
- $(rbm) build release --target release --target browser-all --target basebrowser
-
-basebrowser-release-android-armv7: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-android-armv7 --target basebrowser
-
-basebrowser-release-android-aarch64: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-android-aarch64 --target basebrowser
-
-basebrowser-release-android-x86_64: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-android-x86_64 --target basebrowser
-
-basebrowser-release-linux-x86_64: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-linux-x86_64 --target basebrowser
-
-basebrowser-release-linux-x86_64-asan: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-linux-x86_64-asan --target basebrowser
-
-basebrowser-release-linux-aarch64: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-linux-aarch64 --target basebrowser
-
-basebrowser-release-windows-i686: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-windows-i686 --target basebrowser
-
-basebrowser-release-windows-x86_64: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-windows-x86_64 --target basebrowser
-
-basebrowser-release-macos: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-macos --target basebrowser
-
-basebrowser-release-src: submodule-update
- $(rbm) build release --target release --target browser-single-platform --target browser-src --target basebrowser
-
-basebrowser-alpha: submodule-update
- $(rbm) build release --target alpha --target browser-all --target basebrowser
-
-basebrowser-alpha-android-armv7: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-android-armv7 --target basebrowser
-
-basebrowser-alpha-android-aarch64: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-android-aarch64 --target basebrowser
-
-basebrowser-alpha-android-x86_64: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-android-x86_64 --target basebrowser
-
-basebrowser-alpha-linux-x86_64: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-linux-x86_64 --target basebrowser
-
-basebrowser-alpha-linux-x86_64-asan: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-linux-x86_64-asan --target basebrowser
-
-basebrowser-alpha-linux-aarch64: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-linux-aarch64 --target basebrowser
-
-basebrowser-alpha-windows-i686: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-windows-i686 --target basebrowser
-
-basebrowser-alpha-windows-x86_64: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-windows-x86_64 --target basebrowser
-
-basebrowser-alpha-macos: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-macos --target basebrowser
-
-basebrowser-alpha-src: submodule-update
- $(rbm) build release --target alpha --target browser-single-platform --target browser-src --target basebrowser
-
-basebrowser-nightly: submodule-update
- $(rbm) build release --target nightly --target browser-all --target basebrowser
-
-basebrowser-nightly-android-armv7: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-android-armv7 --target basebrowser
-
-basebrowser-nightly-android-aarch64: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-android-aarch64 --target basebrowser
-
-basebrowser-nightly-android-x86_64: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-android-x86_64 --target basebrowser
-
-basebrowser-nightly-linux-x86_64: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-linux-x86_64 --target basebrowser
-
-basebrowser-nightly-linux-x86_64-asan: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-linux-x86_64-asan --target basebrowser
-
-basebrowser-nightly-linux-aarch64: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-linux-aarch64 --target basebrowser
-
-basebrowser-nightly-windows-i686: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-windows-i686 --target basebrowser
-
-basebrowser-nightly-windows-x86_64: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-windows-x86_64 --target basebrowser
-
-basebrowser-nightly-macos: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-macos --target basebrowser
-
-basebrowser-nightly-src: submodule-update
- $(rbm) build release --target nightly --target browser-single-platform --target browser-src --target basebrowser
-
-basebrowser-testbuild: submodule-update
- $(rbm) build release --target testbuild --target browser-all --target basebrowser
-
-basebrowser-testbuild-android-armv7: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-android-armv7 --target basebrowser
-
-basebrowser-testbuild-android-aarch64: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-android-aarch64 --target basebrowser
-
-basebrowser-testbuild-android-x86_64: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-android-x86_64 --target basebrowser
-
-basebrowser-testbuild-linux-x86_64: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-linux-x86_64 --target basebrowser
-
-basebrowser-testbuild-linux-x86_64-asan: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-linux-x86_64-asan --target basebrowser
-
-basebrowser-testbuild-linux-aarch64: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-linux-aarch64 --target basebrowser
-
-basebrowser-testbuild-windows-x86_64: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-windows-x86_64 --target basebrowser
-
-basebrowser-testbuild-windows-i686: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-windows-i686 --target basebrowser
-
-basebrowser-testbuild-macos: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-macos --target basebrowser
-
-basebrowser-testbuild-macos-x86_64: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-macos-x86_64 --target basebrowser
-
-basebrowser-testbuild-macos-aarch64: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-macos-aarch64 --target basebrowser
-
-basebrowser-testbuild-src: submodule-update
- $(rbm) build release --target testbuild --target browser-single-platform --target browser-src-testbuild --target basebrowser
-
-basebrowser-incrementals-nightly: submodule-update
- $(rbm) build release --step update_responses_config --target nightly --target basebrowser
- NO_CODESIGNATURE=1 tools/update-responses/gen_incrementals nightly
- $(rbm) build release --step hash_incrementals --target nightly --target basebrowser
-
-
###########################
# Mullvad Browser Targets #
###########################
=====================================
README
=====================================
@@ -144,9 +144,9 @@ mar file will be created. If you want to base your testbuild on the latest
nightly code insted, rename rbm.local.conf.example to rbm.local.conf
and adapt the torbrowser-testbuild option accordingly.
-Similar makefile targets exist for building Base Browser and Mullvad Browser
-instead of Tor Browser. To build Base Browser, replace `torbrowser` by
-`basebrowser` in the target name. For Mullvad Browser, use `mullvadbrowser`.
+Similar makefile targets exist for building Mullvad Browser instead of
+Tor Browser. To build Mullvad Browser, replace `torbrowser` by
+`mullvadbrowser` in the target name.
Updating git sources
=====================================
doc/MAKEFILE.txt
=====================================
@@ -82,11 +82,6 @@ torbrowser-{release,alpha,nightly,testbuild}-src
------------------------------------------------
Create source tarballs for firefox and torbutton.
-basebrowser-*
--------------
-The same rules for building Tor Browser also exist for building
-Base Browser.
-
mullvadbrowser-*
----------------
The same rules for building Tor Browser also exist for building
=====================================
projects/browser/config
=====================================
@@ -58,10 +58,6 @@ targets:
prefs_file: 000-tor-browser.js
version_json: tbb_version.json
- basebrowser:
- var:
- prefs_file: 001-base-profile.js
-
mullvadbrowser:
var:
prefs_file: 001-base-profile.js
=====================================
projects/browser/windows-installer/defines.nsh.in
=====================================
@@ -17,11 +17,7 @@
!define DEFAULT_PORTABLE_DIR "$DESKTOP\${DISPLAY_NAME}"
!define EXE_NAME "[% c('var/exe_name') %].exe"
-[% IF !c("var/base-browser") -%]
!define ICON_NAME "[% c('var/projectname') %]-[% c('var/channel') %].ico"
-[% ELSE -%]
- !define ICON_NAME "[% c('var/projectname') %].ico"
-[% END -%]
!define WELCOME_IMAGE "[% c('var/projectname') %]-[% c('var/channel') %].bmp"
[% IF c('var/mullvad-browser') -%]
=====================================
projects/firefox/build
=====================================
@@ -115,7 +115,7 @@ echo "Starting ./mach configure $(date)"
--with-distribution-id=org.torproject \
[% IF !c("var/firefox-browser") %]--with-base-browser-version=[% c("var/torbrowser_version") %][% END %] \
[% IF c("var/updater_enabled") -%]--enable-update-channel=[% c("var/channel") %][% END %] \
- [% IF !c("var/base-browser") && !c("var/firefox-browser") -%]--with-branding="$branding_dir"[% END %] \
+ [% IF !c("var/firefox-browser") -%]--with-branding="$branding_dir"[% END %] \
[% IF !c("var/rlbox") -%]--without-wasm-sandboxed-libraries[% END %]
echo "Starting ./mach build $(date)"
@@ -164,9 +164,6 @@ echo "Starting ./mach build $(date)"
[% IF c("var/macos") -%]
cp -a obj-*/dist/[% c('var/exe_name') %]/* $distdir
- [% IF c("var/base-browser") -%]
- mv "$distdir/Firefox.app" "$distdir/[% c('var/display_name') %].app"
- [% END -%]
[% IF c("var/firefox-browser") -%]
mv "$distdir/Nightly.app" "$distdir/[% c('var/display_name') %].app"
[% END -%]
=====================================
projects/firefox/config
=====================================
@@ -105,11 +105,6 @@ targets:
updater_url: ''
has_l10n: 0
- basebrowser:
- var:
- nightly_updates_publish_dir_prefix: basebrowser-
- mar_id_prefix: 'basebrowser-torproject'
-
nightly:
git_hash: '[% c("var/project-name") %]-[% c("var/firefox_version") %]-[% c("var/browser_branch") %]'
tag_gpg_id: 0
=====================================
projects/go/config
=====================================
@@ -86,4 +86,4 @@ input_files:
- project: go-bootstrap
name: go-bootstrap
target_replace:
- '^.*browser-(?!testbuild).*': 'basebrowser-linux-x86_64'
+ '^.*browser-(?!testbuild).*': 'torbrowser-linux-x86_64'
=====================================
projects/linux-packages/config
=====================================
@@ -108,9 +108,6 @@ targets:
browser_type: torbrowser
system_pkg:
pkg_url: 'https://torproject.org/'
- basebrowser:
- var:
- browser_type: basebrowser
mullvadbrowser:
var:
browser_type: mullvadbrowser
=====================================
projects/release/config
=====================================
@@ -97,9 +97,6 @@ targets:
var:
browser_type: torbrowser
git_tag_prefix: tbb
- basebrowser:
- var:
- browser_type: basebrowser
mullvadbrowser:
var:
browser_type: mullvadbrowser
=====================================
rbm.conf
=====================================
@@ -363,15 +363,6 @@ targets:
project_initials: tb
project_description: 'Tor Browser is a privacy-focused web browser designed to minimize tracking and fingerprinting, using the Tor network to protect your privacy and anonymity.'
- basebrowser:
- var:
- base-browser: 1
- project-name: base-browser
- projectname: basebrowser
- Project_Name: 'Base Browser'
- ProjectName: BaseBrowser
- updater_enabled: '[% c("var/nightly") %]'
-
# Target to build upstream firefox commit (in projects/firefox and
# projects/geckoview) instead of our patched branch
firefoxbrowser:
@@ -422,10 +413,6 @@ targets:
- testbuild
- alpha
- torbrowser
- basebrowser-testbuild:
- - testbuild
- - alpha
- - basebrowser
mullvadbrowser-testbuild:
- testbuild
- alpha
@@ -442,10 +429,6 @@ targets:
- android-armv7
- android
- torbrowser
- basebrowser-android-armv7:
- - android-armv7
- - android
- - basebrowser
firefoxbrowser-android-armv7:
- android-armv7
- android
@@ -462,10 +445,6 @@ targets:
- android-x86_64
- android
- torbrowser
- basebrowser-android-x86_64:
- - android-x86_64
- - android
- - basebrowser
firefoxbrowser-android-x86_64:
- android-x86_64
- android
@@ -482,10 +461,6 @@ targets:
- android-aarch64
- android
- torbrowser
- basebrowser-android-aarch64:
- - android-aarch64
- - android
- - basebrowser
firefoxbrowser-android-aarch64:
- android-aarch64
- android
@@ -528,10 +503,6 @@ targets:
- linux-x86_64
- linux
- torbrowser
- basebrowser-linux-x86_64:
- - linux-x86_64
- - linux
- - basebrowser
mullvadbrowser-linux-x86_64:
- linux-x86_64
- linux
@@ -545,11 +516,6 @@ targets:
- linux-x86_64
- linux
- torbrowser
- basebrowser-linux-x86_64-asan:
- - linux-asan
- - linux-x86_64
- - linux
- - basebrowser
mullvadbrowser-linux-x86_64-asan:
- linux-asan
- linux-x86_64
@@ -560,11 +526,6 @@ targets:
- linux-aarch64
- linux
- torbrowser
- basebrowser-linux-aarch64:
- - linux-cross
- - linux-aarch64
- - linux
- - basebrowser
mullvadbrowser-linux-aarch64:
- linux-cross
- linux-aarch64
@@ -631,10 +592,6 @@ targets:
- windows-i686
- windows
- torbrowser
- basebrowser-windows-i686:
- - windows-i686
- - windows
- - basebrowser
firefoxbrowser-windows-i686:
- windows-i686
- windows
@@ -643,10 +600,6 @@ targets:
- windows-x86_64
- windows
- torbrowser
- basebrowser-windows-x86_64:
- - windows-x86_64
- - windows
- - basebrowser
mullvadbrowser-windows-x86_64:
- windows-x86_64
- windows
@@ -704,19 +657,6 @@ targets:
- macos-aarch64
- macos
- torbrowser
- basebrowser-macos:
- - macos-universal
- - macos-x86_64
- - macos
- - basebrowser
- basebrowser-macos-x86_64:
- - macos-x86_64
- - macos
- - basebrowser
- basebrowser-macos-aarch64:
- - macos-aarch64
- - macos
- - basebrowser
mullvadbrowser-macos:
- macos-universal
- macos-x86_64
=====================================
tools/signing/set-config
=====================================
@@ -14,7 +14,6 @@ test -n "${SIGNING_PROJECTNAME+x}" \
|| exit_error 'SIGNING_PROJECTNAME is not set'
test "$SIGNING_PROJECTNAME" = 'torbrowser' \
- || test "$SIGNING_PROJECTNAME" = 'basebrowser' \
|| test "$SIGNING_PROJECTNAME" = 'mullvadbrowser' \
|| test "$SIGNING_PROJECTNAME" = 'torvpn' \
|| exit_error "Unknown SIGNING_PROJECTNAME $SIGNING_PROJECTNAME"
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/a…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/a…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser] Pushed new tag FIREFOX_140_7_1esr_BUILD1
by ma1 (@ma1) 16 Feb '26
by ma1 (@ma1) 16 Feb '26
16 Feb '26
ma1 pushed new tag FIREFOX_140_7_1esr_BUILD1 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/FIREFOX_1…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser] Pushed new branch tor-browser-140.7.1esr-15.0-1
by ma1 (@ma1) 16 Feb '26
by ma1 (@ma1) 16 Feb '26
16 Feb '26
ma1 pushed new branch tor-browser-140.7.1esr-15.0-1 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/tor-brows…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser] Pushed new branch base-browser-140.7.1esr-15.0-1
by ma1 (@ma1) 16 Feb '26
by ma1 (@ma1) 16 Feb '26
16 Feb '26
ma1 pushed new branch base-browser-140.7.1esr-15.0-1 at The Tor Project / Applications / Tor Browser
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/tree/base-brow…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/mullvad-browser][mullvad-browser-147.0a1-16.0-2] No Bug: DROP ME AND d65bdc8bdcc1 IN THE 148 REBASE. Revert "fixup! Tor Browser...
by henry (@henry) 12 Feb '26
by henry (@henry) 12 Feb '26
12 Feb '26
henry pushed to branch mullvad-browser-147.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser
Commits:
f73ec6d4 by Henry Wilkes at 2026-02-12T19:27:17+00:00
No Bug: DROP ME AND d65bdc8bdcc1 IN THE 148 REBASE. Revert "fixup! Tor Browser localization migration scripts."
Revert "fixup! Tor Browser localization migration scripts."
This reverts commit d65bdc8bdcc17846310c4a61395962641dc69d89.
Commit was accidentally added from tor-browser!1842 even though it is
not meant for mullvad-browser.
Please drop this commit and d65bdc8bdcc1 in the next mullvad-browser
rebase to clean up!
- - - - -
1 changed file:
- − tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
Changes:
=====================================
tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py deleted
=====================================
@@ -1,24 +0,0 @@
-from fluent.migrate.helpers import transforms_from
-
-
-def migrate(ctx):
- ctx.add_transforms(
- "base-browser.ftl",
- "base-browser.ftl",
- transforms_from(
- """
-letterboxing-window-size-group =
- .label = { COPY_PATTERN(path, "letterboxing-window-size-header") }
-letterboxing-alignment-group =
- .label = { COPY_PATTERN(path, "letterboxing-alignment-header") }
- .description = { COPY_PATTERN(path, "letterboxing-alignment-description") }
-letterboxing-alignment-top-option =
- .label = { COPY_PATTERN(path, "letterboxing-alignment-top") }
-letterboxing-alignment-middle-option =
- .label = { COPY_PATTERN(path, "letterboxing-alignment-middle") }
-letterboxing-disabled-message =
- .message = { COPY_PATTERN(path, "letterboxing-disabled-description") }
-""",
- path="base-browser.ftl",
- ),
- )
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/f73…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/f73…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser][base-browser-147.0a1-16.0-2] No Bug: Revert "fixup! Tor Browser localization migration scripts."
by henry (@henry) 12 Feb '26
by henry (@henry) 12 Feb '26
12 Feb '26
henry pushed to branch base-browser-147.0a1-16.0-2 at The Tor Project / Applications / Tor Browser
Commits:
eace3485 by Henry Wilkes at 2026-02-12T19:15:17+00:00
No Bug: Revert "fixup! Tor Browser localization migration scripts."
This reverts commit f8ce3c000fab257b0f64161546f43aeb8c33e10e.
Commit was accidentally added from tor-browser!1842 even though it is
not meant for base-browser.
- - - - -
1 changed file:
- − tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
Changes:
=====================================
tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py deleted
=====================================
@@ -1,24 +0,0 @@
-from fluent.migrate.helpers import transforms_from
-
-
-def migrate(ctx):
- ctx.add_transforms(
- "base-browser.ftl",
- "base-browser.ftl",
- transforms_from(
- """
-letterboxing-window-size-group =
- .label = { COPY_PATTERN(path, "letterboxing-window-size-header") }
-letterboxing-alignment-group =
- .label = { COPY_PATTERN(path, "letterboxing-alignment-header") }
- .description = { COPY_PATTERN(path, "letterboxing-alignment-description") }
-letterboxing-alignment-top-option =
- .label = { COPY_PATTERN(path, "letterboxing-alignment-top") }
-letterboxing-alignment-middle-option =
- .label = { COPY_PATTERN(path, "letterboxing-alignment-middle") }
-letterboxing-disabled-message =
- .message = { COPY_PATTERN(path, "letterboxing-disabled-description") }
-""",
- path="base-browser.ftl",
- ),
- )
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/eace348…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/eace348…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/mullvad-browser][mullvad-browser-147.0a1-16.0-2] 3 commits: fixup! BB 41916: Letterboxing preferences UI
by henry (@henry) 12 Feb '26
by henry (@henry) 12 Feb '26
12 Feb '26
henry pushed to branch mullvad-browser-147.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser
Commits:
8837626c by Henry Wilkes at 2026-02-12T18:17:05+00:00
fixup! BB 41916: Letterboxing preferences UI
TB 44459: Use settings config for Letterboxing.
- - - - -
5060a081 by Henry Wilkes at 2026-02-12T18:17:07+00:00
fixup! Base Browser strings
TB 44459: Convert letterboxing setting strings.
- - - - -
d65bdc8b by Henry Wilkes at 2026-02-12T18:17:08+00:00
fixup! Tor Browser localization migration scripts.
TB 44459: Migration recipe to create the new letterboxing strings for
other locales.
- - - - -
13 changed files:
- browser/components/preferences/jar.mn
- − browser/components/preferences/letterboxing-middle-dark.svg
- − browser/components/preferences/letterboxing-middle-light.svg
- + browser/components/preferences/letterboxing-middle.svg
- − browser/components/preferences/letterboxing-top-dark.svg
- − browser/components/preferences/letterboxing-top-light.svg
- + browser/components/preferences/letterboxing-top.svg
- browser/components/preferences/letterboxing.css
- browser/components/preferences/letterboxing.inc.xhtml
- browser/components/preferences/letterboxing.js
- browser/components/preferences/main.js
- toolkit/locales/en-US/toolkit/global/base-browser.ftl
- + tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
Changes:
=====================================
browser/components/preferences/jar.mn
=====================================
@@ -45,7 +45,5 @@ browser.jar:
content/browser/preferences/letterboxing.js
content/browser/preferences/letterboxing.css
- content/browser/preferences/letterboxing-middle-dark.svg
- content/browser/preferences/letterboxing-middle-light.svg
- content/browser/preferences/letterboxing-top-dark.svg
- content/browser/preferences/letterboxing-top-light.svg
+ content/browser/preferences/letterboxing-middle.svg
+ content/browser/preferences/letterboxing-top.svg
=====================================
browser/components/preferences/letterboxing-middle-dark.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_2272_529)">
-<g clip-path="url(#clip0_2272_529)">
-<path d="M58 3H4V45H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="white"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="white"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="white"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="white"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="white"/>
-<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
-<rect x="8" y="18" width="46" height="23" rx="2" fill="#3A3944"/>
-<path d="M38 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H38C38.5523 24 39 23.5523 39 23C39 22.4477 38.5523 22 38 22Z" fill="white"/>
-<path d="M27 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H27C27.5523 28 28 27.5523 28 27C28 26.4477 27.5523 26 27 26Z" fill="white"/>
-<path d="M42 30H13C12.4477 30 12 30.4477 12 31C12 31.5523 12.4477 32 13 32H42C42.5523 32 43 31.5523 43 31C43 30.4477 42.5523 30 42 30Z" fill="white"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_2272_529" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_529"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_529" result="shape"/>
-</filter>
-<clipPath id="clip0_2272_529">
-<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-middle-light.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_202_960)">
-<g clip-path="url(#clip0_202_960)">
-<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="#52525E"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="#52525E"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="#52525E"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="#52525E"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="#52525E"/>
-<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
-<rect x="8" y="18" width="46" height="23" rx="2" fill="white"/>
-<path d="M38 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H38C38.5523 24 39 23.5523 39 23C39 22.4477 38.5523 22 38 22Z" fill="#52525E"/>
-<path d="M27 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H27C27.5523 28 28 27.5523 28 27C28 26.4477 27.5523 26 27 26Z" fill="#52525E"/>
-<path d="M42 30H13C12.4477 30 12 30.4477 12 31C12 31.5523 12.4477 32 13 32H42C42.5523 32 43 31.5523 43 31C43 30.4477 42.5523 30 42 30Z" fill="#52525E"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_202_960" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_960"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_960" result="shape"/>
-</filter>
-<clipPath id="clip0_202_960">
-<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-middle.svg
=====================================
@@ -0,0 +1,20 @@
+<svg width="54" height="42" xmlns="http://www.w3.org/2000/svg">
+<rect width="54" height="42" fill="light-dark(#CFCFD8, #5B5B66)"/>
+<rect width="54" height="11" fill="light-dark(#F0F0F4, #42414D)"/>
+<rect width="54" height="5" fill="light-dark(#E0E0E6, #2B2A33)"/>
+<g fill="light-dark(#52525E, white)">
+ <rect x="5" y="2" width="12" height="2" rx="1"/>
+ <rect x="50" y="7" width="2" height="2" rx="1"/>
+ <rect x="2" y="7" width="2" height="2" rx="1"/>
+ <rect x="6" y="7" width="2" height="2" rx="1"/>
+ <rect x="10" y="7" width="38" height="2" rx="1"/>
+</g>
+<g fill="light-dark(white, #3A3944)">
+ <rect x="4" y="15" width="46" height="23" rx="2"/>
+</g>
+<g fill="light-dark(#52525E, white)">
+ <rect x="8" y="19" width="27" height="2" rx="1"/>
+ <rect x="8" y="23" width="16" height="2" rx="1"/>
+ <rect x="8" y="27" width="31" height="2" rx="1"/>
+</g>
+</svg>
=====================================
browser/components/preferences/letterboxing-top-dark.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_2272_508)">
-<g clip-path="url(#clip0_2272_508)">
-<path d="M58 3H4V45H58V3Z" fill="#52525E"/>
-<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="white"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="white"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="white"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="white"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="white"/>
-<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
-<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="#3A3944"/>
-<path d="M38 18H13C12.4477 18 12 18.4477 12 19C12 19.5523 12.4477 20 13 20H38C38.5523 20 39 19.5523 39 19C39 18.4477 38.5523 18 38 18Z" fill="white"/>
-<path d="M27 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H27C27.5523 24 28 23.5523 28 23C28 22.4477 27.5523 22 27 22Z" fill="white"/>
-<path d="M42 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H42C42.5523 28 43 27.5523 43 27C43 26.4477 42.5523 26 42 26Z" fill="white"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_2272_508" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_508"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_508" result="shape"/>
-</filter>
-<clipPath id="clip0_2272_508">
-<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-top-light.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_202_926)">
-<g clip-path="url(#clip0_202_926)">
-<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="#52525E"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="#52525E"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="#52525E"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="#52525E"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="#52525E"/>
-<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
-<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="white"/>
-<path d="M38 18H13C12.4477 18 12 18.4477 12 19C12 19.5523 12.4477 20 13 20H38C38.5523 20 39 19.5523 39 19C39 18.4477 38.5523 18 38 18Z" fill="#52525E"/>
-<path d="M27 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H27C27.5523 24 28 23.5523 28 23C28 22.4477 27.5523 22 27 22Z" fill="#52525E"/>
-<path d="M42 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H42C42.5523 28 43 27.5523 43 27C43 26.4477 42.5523 26 42 26Z" fill="#52525E"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_202_926" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_926"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_926" result="shape"/>
-</filter>
-<clipPath id="clip0_202_926">
-<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-top.svg
=====================================
@@ -0,0 +1,21 @@
+<svg width="54" height="42" xmlns="http://www.w3.org/2000/svg">
+<rect width="54" height="42" fill="light-dark(#CFCFD8, #5B5B66)"/>
+<rect width="54" height="11" fill="light-dark(#F0F0F4, #42414D)"/>
+<rect width="54" height="5" fill="light-dark(#E0E0E6, #2B2A33)"/>
+<g fill="light-dark(#52525E, white)">
+ <rect x="5" y="2" width="12" height="2" rx="1"/>
+ <rect x="50" y="7" width="2" height="2" rx="1"/>
+ <rect x="2" y="7" width="2" height="2" rx="1"/>
+ <rect x="6" y="7" width="2" height="2" rx="1"/>
+ <rect x="10" y="7" width="38" height="2" rx="1"/>
+</g>
+<g fill="light-dark(white, #3A3944)">
+ <rect x="4" y="11" width="46" height="27" rx="2"/>
+ <rect x="4" y="11" width="46" height="4"/>
+</g>
+<g fill="light-dark(#52525E, white)">
+ <rect x="8" y="15" width="27" height="2" rx="1"/>
+ <rect x="8" y="19" width="16" height="2" rx="1"/>
+ <rect x="8" y="23" width="31" height="2" rx="1"/>
+</g>
+</svg>
=====================================
browser/components/preferences/letterboxing.css
=====================================
@@ -1,69 +1,11 @@
-.letterboxing-overview {
- margin-block-end: 32px;
-}
-
-.letterboxing-search-overview {
- margin-block-end: 16px;
-}
-#letterboxingAligner {
- display: flex;
- justify-content: start;
- gap: 16px;
- margin-block: 12px;
-
- --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-light.svg");
- --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-light.svg");
-}
-
-@media (prefers-color-scheme: dark) {
- #letterboxingAligner {
- --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-dark.svg");
- --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-dark.svg");
- }
-}
-
-#letterboxingAligner .letterboxing-align-top img {
- content: var(--letterboxing-alignment-img-top);
-}
-#letterboxingAligner .letterboxing-align-middle img {
- content: var(--letterboxing-alignment-img-middle);
-}
-
-#letterboxingAligner label {
- width: 200px;
- flex: 0 0 auto;
-}
-
-#letterboxingAligner img {
- border: none;
- box-shadow: none;
-}
-
-/* Hide letterboxing options depending on whether ResistFingerprinting or
- * Letterboxing is enabled. */
-#letterboxingCategory:not(.rfp-enabled),
-#letterboxingCategory:not(.rfp-enabled) ~ #letterboxingDisabled,
-#letterboxingCategory.letterboxing-enabled ~ #letterboxingDisabled,
-#letterboxingCategory:not(.rfp-enabled.letterboxing-enabled) ~ .letterboxing-category {
+#letterboxingCategory.hide-all-letterboxing {
display: none;
}
-/* We duplicate the Letterboxing overview to appear in search results.
- * We want to hide them whenever they are *not* part of a search result. */
-:is(
- /* Hide the duplicates when the category is *not* hidden. */
- #letterboxingCategory:not(.visually-hidden) ~ .letterboxing-category,
- /* Also hide the duplicated overview for subsequence search results if a
- * previous groupbox is *not* hidden. */
- .letterboxing-category:not(.visually-hidden) ~ .letterboxing-category,
-) .letterboxing-search-overview {
- display: none;
+.letterboxing-overview {
+ margin-block-end: var(--space-xxlarge);
}
-/* Similarly for #letterboxingDisabled, but we also want to hide its
- * "Letterboxing" heading.
- * NOTE: This should only appear in isolation, so we do not need to worry about
- * subsequent groupboxes. */
-#letterboxingCategory:not(.visually-hidden) ~ #letterboxingDisabled :is(.letterboxing-search-heading, .letterboxing-search-overview) {
- display: none;
+.letterboxing-chooser-item.appearance-chooser-item {
+ flex: 0 1 200px;
}
=====================================
browser/components/preferences/letterboxing.inc.xhtml
=====================================
@@ -15,100 +15,12 @@
></html:a>
</description>
</vbox>
-<groupbox
- class="letterboxing-category"
- data-category="paneGeneral"
- hidden="true"
->
- <label><html:h2
- data-l10n-id="letterboxing-window-size-header"/></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <checkbox
- id="letterboxingRememberSize"
- data-l10n-id="letterboxing-remember-size"
- preference="privacy.resistFingerprinting.letterboxing.rememberSize"
- />
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingDisabled"></html:setting-group>
</groupbox>
-<groupbox
- class="letterboxing-category"
- data-category="paneGeneral"
- hidden="true"
->
- <label><html:h2
- data-l10n-id="letterboxing-alignment-header"
- /></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <description
- id="letterboxingAlignmentDesc"
- flex="1"
- data-l10n-id="letterboxing-alignment-description"
- />
- <form
- xmlns="http://www.w3.org/1999/xhtml"
- id="letterboxingAligner"
- autocomplete="off"
- aria-labelledby="letterboxingAlignmentDesc"
- >
- <label class="web-appearance-choice letterboxing-align-top">
- <div class="web-appearance-choice-image-container">
- <img role="presentation" />
- </div>
- <div class="web-appearance-choice-footer">
- <input type="radio" name="alignment" value="top" />
- <span data-l10n-id="letterboxing-alignment-top"></span>
- </div>
- </label>
- <label class="web-appearance-choice letterboxing-align-middle">
- <div class="web-appearance-choice-image-container">
- <img role="presentation" />
- </div>
- <div class="web-appearance-choice-footer">
- <input type="radio" name="alignment" value="middle" />
- <span data-l10n-id="letterboxing-alignment-middle"></span>
- </div>
- </label>
- </form>
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingSize"></html:setting-group>
</groupbox>
-<groupbox
- id="letterboxingDisabled"
- data-category="paneGeneral"
- hidden="true"
->
- <label class="letterboxing-search-heading"><html:h2
- data-l10n-id="letterboxing-header"/></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <hbox align="center">
- <label
- class="face-sad"
- flex="1"
- data-l10n-id="letterboxing-disabled-description"
- />
- <button
- id="letterboxingEnableButton"
- class="accessory-button"
- is="highlightable-button"
- data-l10n-id="letterboxing-enable-button"
- />
- </hbox>
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingAlignment"></html:setting-group>
</groupbox>
=====================================
browser/components/preferences/letterboxing.js
=====================================
@@ -1,112 +1,155 @@
-/* import-globals-from /browser/components/preferences/preferences.js */
-/* import-globals-from /browser/components/preferences/findInPage.js */
-/* import-globals-from /toolkit/content/preferencesBindings.js */
+/* import-globals-from preferences.js */
+/* import-globals-from findInPage.js */
Preferences.addAll([
+ {
+ id: "privacy.resistFingerprinting.letterboxing",
+ type: "bool",
+ },
{
id: "privacy.resistFingerprinting.letterboxing.rememberSize",
type: "bool",
},
+ {
+ id: "privacy.resistFingerprinting.letterboxing.vcenter",
+ type: "bool",
+ },
]);
-{
- const lbEnabledPref = "privacy.resistFingerprinting.letterboxing";
- const visibilityPrefs = ["privacy.resistFingerprinting", lbEnabledPref];
- const alignMiddlePref = "privacy.resistFingerprinting.letterboxing.vcenter";
+Preferences.addSetting({
+ id: "letterboxingEnabled",
+ pref: "privacy.resistFingerprinting.letterboxing",
+});
- const hideFromSearchIf = (mustHide, ...elements) => {
- for (const element of elements) {
- if (mustHide) {
- element.setAttribute("data-hidden-from-search", "true");
- } else {
- element.removeAttribute("data-hidden-from-search");
- }
- }
- };
-
- const syncVisibility = () => {
- const [rfpEnabled, letterboxingEnabled] = visibilityPrefs.map(pref =>
- Services.prefs.getBoolPref(pref, false)
- );
- const categoryElement = document.getElementById("letterboxingCategory");
- const { classList } = categoryElement;
-
- // Show the letterboxing section only if resistFingerprinting is enabled
- classList.toggle("rfp-enabled", rfpEnabled);
- classList.toggle("letterboxing-enabled", letterboxingEnabled);
+Preferences.addSetting({
+ id: "letterboxingRememberSize",
+ pref: "privacy.resistFingerprinting.letterboxing.rememberSize",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return letterboxingEnabled.value && resistFingerprinting.value;
+ },
+});
- // To ensure the hidden parts do not contribute to search results, we need
- // to add "data-hidden-from-search".
- hideFromSearchIf(
- !rfpEnabled || !letterboxingEnabled,
- ...document.querySelectorAll(".letterboxing-category")
- );
- hideFromSearchIf(
- !rfpEnabled || letterboxingEnabled,
- document.getElementById("letterboxingDisabled")
- );
- };
+Preferences.addSetting({
+ id: "letterboxingContentAlignment",
+ pref: "privacy.resistFingerprinting.letterboxing.vcenter",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return letterboxingEnabled.value && resistFingerprinting.value;
+ },
+ get: val => {
+ return val ? "middle" : "top";
+ },
+ set: val => {
+ return val == "middle";
+ },
+});
- const onVisibilityPrefChange = () => {
- syncVisibility();
- // NOTE: Firefox does not expect "data-hidden-from-search" to change
- // dynamically after page initialization. So we need to manually recall the
- // methods that use "data-hidden-from-search". I.e. the "search" method,
- // using the currently shown category.
- // NOTE: We skip this if we are just initializing on page load.
- // NOTE: data-hidden-from-search is also used when the user has entered a
- // search term. We do not update the results in this case. Instead, it will
- // update when the search term changes or is cleared.
- if (!gSearchResultsPane.query) {
- search(gLastCategory.category, "data-category");
+Preferences.addSetting({
+ id: "letterboxingShouldEnable",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return !letterboxingEnabled.value && resistFingerprinting.value;
+ },
+ onUserClick: (e, { letterboxingEnabled }) => {
+ const buttonEl = document.getElementById("enableLetterboxingButton");
+ if (!buttonEl?.contains(e.target)) {
+ return;
}
- };
-
- const alignerId = "letterboxingAligner";
- const syncAligner = () => {
- const value = Services.prefs.getBoolPref(alignMiddlePref)
- ? "middle"
- : "top";
- document.querySelector(`#${alignerId} input[value="${value}"]`).checked =
- true;
- };
-
- var gLetterboxingPrefs = {
- init() {
- syncVisibility();
- document
- .getElementById("letterboxingEnableButton")
- .addEventListener("command", () => {
- Services.prefs.setBoolPref(lbEnabledPref, true);
- // Button should have focus when activated but will be hidden now,
- // so re-assign focus to the newly revealed options.
- Services.focus.moveFocus(
- window,
- document.querySelector(".letterboxing-category"),
- Services.focus.MOVEFOCUS_FIRST,
- 0
- );
- });
- for (const pref of visibilityPrefs) {
- Services.prefs.addObserver(pref, onVisibilityPrefChange);
+ letterboxingEnabled.value = true;
+ setTimeout(() => {
+ // Need to re-search to remove the "hidden" attribute on the groupbox
+ // elements (after the data-hidden-from-search attributes are changed by
+ // the "visible" callback).
+ // TODO: Is this an upstream issue that "hidden" is not removed?
+ if (!gSearchResultsPane.query) {
+ search(gLastCategory.category, "data-category");
}
+ // Button should have focus when activated but will be hidden now,
+ // so re-assign focus to the newly revealed options.
+ Services.focus.moveFocus(
+ window,
+ buttonEl,
+ Services.focus.MOVEFOCUS_FORWARD,
+ 0
+ );
+ });
+ },
+});
- syncAligner();
- document.getElementById(alignerId).addEventListener("change", e => {
- // NOTE: the "change" event is only fired on the checked input.
- Services.prefs.setBoolPref(
- alignMiddlePref,
- e.target.value === "middle"
- );
- });
- Services.prefs.addObserver(alignMiddlePref, syncAligner);
- },
+SettingGroupManager.registerGroups({
+ letterboxingDisabled: {
+ items: [
+ {
+ id: "letterboxingShouldEnable",
+ l10nId: "letterboxing-disabled-message",
+ control: "moz-promo",
+ options: [
+ {
+ control: "moz-button",
+ l10nId: "letterboxing-enable-button",
+ id: "enableLetterboxingButton",
+ slot: "actions",
+ },
+ ],
+ },
+ ],
+ },
+ letterboxingSize: {
+ l10nId: "letterboxing-window-size-group",
+ headingLevel: 2,
+ items: [
+ {
+ id: "letterboxingRememberSize",
+ l10nId: "letterboxing-remember-size",
+ control: "moz-checkbox",
+ },
+ ],
+ },
+ letterboxingAlignment: {
+ l10nId: "letterboxing-alignment-group",
+ headingLevel: 2,
+ items: [
+ {
+ id: "letterboxingContentAlignment",
+ control: "moz-visual-picker",
+ options: [
+ {
+ value: "top",
+ l10nId: "letterboxing-alignment-top-option",
+ controlAttrs: {
+ class: "appearance-chooser-item letterboxing-chooser-item",
+ imagesrc:
+ "chrome://browser/content/preferences/letterboxing-top.svg",
+ },
+ },
+ {
+ value: "middle",
+ l10nId: "letterboxing-alignment-middle-option",
+ controlAttrs: {
+ class: "appearance-chooser-item letterboxing-chooser-item",
+ imagesrc:
+ "chrome://browser/content/preferences/letterboxing-middle.svg",
+ },
+ },
+ ],
+ },
+ ],
+ },
+});
- destroy() {
- for (const pref of visibilityPrefs) {
- Services.prefs.removeObserver(pref, onVisibilityPrefChange);
- }
- Services.prefs.removeObserver(alignMiddlePref, syncAligner);
- },
- };
-}
+var gLetterboxingPrefs = {
+ init() {
+ const rfpSetting = Preferences.getSetting("resistFingerprinting");
+ const updateCategoryVisibility = () => {
+ document
+ .getElementById("letterboxingCategory")
+ .classList.toggle("hide-all-letterboxing", !rfpSetting.value);
+ };
+ rfpSetting.on("change", updateCategoryVisibility);
+ updateCategoryVisibility();
+ initSettingGroup("letterboxingDisabled");
+ initSettingGroup("letterboxingSize");
+ initSettingGroup("letterboxingAlignment");
+ },
+};
=====================================
browser/components/preferences/main.js
=====================================
@@ -5013,8 +5013,6 @@ var gMainPane = {
this._translationsView.destroy();
this._translationsView = null;
}
-
- gLetterboxingPrefs.destroy();
},
// nsISupports
=====================================
toolkit/locales/en-US/toolkit/global/base-browser.ftl
=====================================
@@ -81,17 +81,22 @@ letterboxing-header = Letterboxing
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
letterboxing-overview = { -brand-short-name }'s Letterboxing feature restricts websites to display at specific sizes, making it harder to single out users on the basis of their window or screen size.
letterboxing-learn-more = Learn more
-letterboxing-window-size-header = Window size
+letterboxing-window-size-group =
+ .label = Window size
letterboxing-remember-size =
.label = Reuse last window size when opening a new window
.accesskey = R
-letterboxing-alignment-header = Content alignment
-letterboxing-alignment-description = Choose where you want to align the website’s content.
-letterboxing-alignment-top = Top
-letterboxing-alignment-middle = Middle
+letterboxing-alignment-group =
+ .label = Content alignment
+ .description = Choose where you want to align the website’s content.
+letterboxing-alignment-top-option =
+ .label = Top
+letterboxing-alignment-middle-option =
+ .label = Middle
# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
-letterboxing-disabled-description = Letterboxing is currently disabled.
+letterboxing-disabled-message =
+ .message = Letterboxing is currently disabled.
# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
letterboxing-enable-button =
=====================================
tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
=====================================
@@ -0,0 +1,24 @@
+from fluent.migrate.helpers import transforms_from
+
+
+def migrate(ctx):
+ ctx.add_transforms(
+ "base-browser.ftl",
+ "base-browser.ftl",
+ transforms_from(
+ """
+letterboxing-window-size-group =
+ .label = { COPY_PATTERN(path, "letterboxing-window-size-header") }
+letterboxing-alignment-group =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-header") }
+ .description = { COPY_PATTERN(path, "letterboxing-alignment-description") }
+letterboxing-alignment-top-option =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-top") }
+letterboxing-alignment-middle-option =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-middle") }
+letterboxing-disabled-message =
+ .message = { COPY_PATTERN(path, "letterboxing-disabled-description") }
+""",
+ path="base-browser.ftl",
+ ),
+ )
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/9f…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/9f…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser][base-browser-147.0a1-16.0-2] 3 commits: fixup! BB 41916: Letterboxing preferences UI
by henry (@henry) 12 Feb '26
by henry (@henry) 12 Feb '26
12 Feb '26
henry pushed to branch base-browser-147.0a1-16.0-2 at The Tor Project / Applications / Tor Browser
Commits:
bbdba49f by Henry Wilkes at 2026-02-12T18:12:34+00:00
fixup! BB 41916: Letterboxing preferences UI
TB 44459: Use settings config for Letterboxing.
- - - - -
53858716 by Henry Wilkes at 2026-02-12T18:12:35+00:00
fixup! Base Browser strings
TB 44459: Convert letterboxing setting strings.
- - - - -
f8ce3c00 by Henry Wilkes at 2026-02-12T18:12:36+00:00
fixup! Tor Browser localization migration scripts.
TB 44459: Migration recipe to create the new letterboxing strings for
other locales.
- - - - -
13 changed files:
- browser/components/preferences/jar.mn
- − browser/components/preferences/letterboxing-middle-dark.svg
- − browser/components/preferences/letterboxing-middle-light.svg
- + browser/components/preferences/letterboxing-middle.svg
- − browser/components/preferences/letterboxing-top-dark.svg
- − browser/components/preferences/letterboxing-top-light.svg
- + browser/components/preferences/letterboxing-top.svg
- browser/components/preferences/letterboxing.css
- browser/components/preferences/letterboxing.inc.xhtml
- browser/components/preferences/letterboxing.js
- browser/components/preferences/main.js
- toolkit/locales/en-US/toolkit/global/base-browser.ftl
- + tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
Changes:
=====================================
browser/components/preferences/jar.mn
=====================================
@@ -45,7 +45,5 @@ browser.jar:
content/browser/preferences/letterboxing.js
content/browser/preferences/letterboxing.css
- content/browser/preferences/letterboxing-middle-dark.svg
- content/browser/preferences/letterboxing-middle-light.svg
- content/browser/preferences/letterboxing-top-dark.svg
- content/browser/preferences/letterboxing-top-light.svg
+ content/browser/preferences/letterboxing-middle.svg
+ content/browser/preferences/letterboxing-top.svg
=====================================
browser/components/preferences/letterboxing-middle-dark.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_2272_529)">
-<g clip-path="url(#clip0_2272_529)">
-<path d="M58 3H4V45H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="white"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="white"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="white"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="white"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="white"/>
-<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
-<rect x="8" y="18" width="46" height="23" rx="2" fill="#3A3944"/>
-<path d="M38 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H38C38.5523 24 39 23.5523 39 23C39 22.4477 38.5523 22 38 22Z" fill="white"/>
-<path d="M27 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H27C27.5523 28 28 27.5523 28 27C28 26.4477 27.5523 26 27 26Z" fill="white"/>
-<path d="M42 30H13C12.4477 30 12 30.4477 12 31C12 31.5523 12.4477 32 13 32H42C42.5523 32 43 31.5523 43 31C43 30.4477 42.5523 30 42 30Z" fill="white"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_2272_529" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_529"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_529" result="shape"/>
-</filter>
-<clipPath id="clip0_2272_529">
-<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-middle-light.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_202_960)">
-<g clip-path="url(#clip0_202_960)">
-<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="#52525E"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="#52525E"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="#52525E"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="#52525E"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="#52525E"/>
-<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
-<rect x="8" y="18" width="46" height="23" rx="2" fill="white"/>
-<path d="M38 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H38C38.5523 24 39 23.5523 39 23C39 22.4477 38.5523 22 38 22Z" fill="#52525E"/>
-<path d="M27 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H27C27.5523 28 28 27.5523 28 27C28 26.4477 27.5523 26 27 26Z" fill="#52525E"/>
-<path d="M42 30H13C12.4477 30 12 30.4477 12 31C12 31.5523 12.4477 32 13 32H42C42.5523 32 43 31.5523 43 31C43 30.4477 42.5523 30 42 30Z" fill="#52525E"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_202_960" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_960"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_960" result="shape"/>
-</filter>
-<clipPath id="clip0_202_960">
-<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-middle.svg
=====================================
@@ -0,0 +1,20 @@
+<svg width="54" height="42" xmlns="http://www.w3.org/2000/svg">
+<rect width="54" height="42" fill="light-dark(#CFCFD8, #5B5B66)"/>
+<rect width="54" height="11" fill="light-dark(#F0F0F4, #42414D)"/>
+<rect width="54" height="5" fill="light-dark(#E0E0E6, #2B2A33)"/>
+<g fill="light-dark(#52525E, white)">
+ <rect x="5" y="2" width="12" height="2" rx="1"/>
+ <rect x="50" y="7" width="2" height="2" rx="1"/>
+ <rect x="2" y="7" width="2" height="2" rx="1"/>
+ <rect x="6" y="7" width="2" height="2" rx="1"/>
+ <rect x="10" y="7" width="38" height="2" rx="1"/>
+</g>
+<g fill="light-dark(white, #3A3944)">
+ <rect x="4" y="15" width="46" height="23" rx="2"/>
+</g>
+<g fill="light-dark(#52525E, white)">
+ <rect x="8" y="19" width="27" height="2" rx="1"/>
+ <rect x="8" y="23" width="16" height="2" rx="1"/>
+ <rect x="8" y="27" width="31" height="2" rx="1"/>
+</g>
+</svg>
=====================================
browser/components/preferences/letterboxing-top-dark.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_2272_508)">
-<g clip-path="url(#clip0_2272_508)">
-<path d="M58 3H4V45H58V3Z" fill="#52525E"/>
-<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="white"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="white"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="white"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="white"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="white"/>
-<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
-<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="#3A3944"/>
-<path d="M38 18H13C12.4477 18 12 18.4477 12 19C12 19.5523 12.4477 20 13 20H38C38.5523 20 39 19.5523 39 19C39 18.4477 38.5523 18 38 18Z" fill="white"/>
-<path d="M27 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H27C27.5523 24 28 23.5523 28 23C28 22.4477 27.5523 22 27 22Z" fill="white"/>
-<path d="M42 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H42C42.5523 28 43 27.5523 43 27C43 26.4477 42.5523 26 42 26Z" fill="white"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_2272_508" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_508"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_508" result="shape"/>
-</filter>
-<clipPath id="clip0_2272_508">
-<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-top-light.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_202_926)">
-<g clip-path="url(#clip0_202_926)">
-<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="#52525E"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="#52525E"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="#52525E"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="#52525E"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="#52525E"/>
-<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
-<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="white"/>
-<path d="M38 18H13C12.4477 18 12 18.4477 12 19C12 19.5523 12.4477 20 13 20H38C38.5523 20 39 19.5523 39 19C39 18.4477 38.5523 18 38 18Z" fill="#52525E"/>
-<path d="M27 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H27C27.5523 24 28 23.5523 28 23C28 22.4477 27.5523 22 27 22Z" fill="#52525E"/>
-<path d="M42 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H42C42.5523 28 43 27.5523 43 27C43 26.4477 42.5523 26 42 26Z" fill="#52525E"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_202_926" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_926"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_926" result="shape"/>
-</filter>
-<clipPath id="clip0_202_926">
-<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-top.svg
=====================================
@@ -0,0 +1,21 @@
+<svg width="54" height="42" xmlns="http://www.w3.org/2000/svg">
+<rect width="54" height="42" fill="light-dark(#CFCFD8, #5B5B66)"/>
+<rect width="54" height="11" fill="light-dark(#F0F0F4, #42414D)"/>
+<rect width="54" height="5" fill="light-dark(#E0E0E6, #2B2A33)"/>
+<g fill="light-dark(#52525E, white)">
+ <rect x="5" y="2" width="12" height="2" rx="1"/>
+ <rect x="50" y="7" width="2" height="2" rx="1"/>
+ <rect x="2" y="7" width="2" height="2" rx="1"/>
+ <rect x="6" y="7" width="2" height="2" rx="1"/>
+ <rect x="10" y="7" width="38" height="2" rx="1"/>
+</g>
+<g fill="light-dark(white, #3A3944)">
+ <rect x="4" y="11" width="46" height="27" rx="2"/>
+ <rect x="4" y="11" width="46" height="4"/>
+</g>
+<g fill="light-dark(#52525E, white)">
+ <rect x="8" y="15" width="27" height="2" rx="1"/>
+ <rect x="8" y="19" width="16" height="2" rx="1"/>
+ <rect x="8" y="23" width="31" height="2" rx="1"/>
+</g>
+</svg>
=====================================
browser/components/preferences/letterboxing.css
=====================================
@@ -1,69 +1,11 @@
-.letterboxing-overview {
- margin-block-end: 32px;
-}
-
-.letterboxing-search-overview {
- margin-block-end: 16px;
-}
-#letterboxingAligner {
- display: flex;
- justify-content: start;
- gap: 16px;
- margin-block: 12px;
-
- --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-light.svg");
- --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-light.svg");
-}
-
-@media (prefers-color-scheme: dark) {
- #letterboxingAligner {
- --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-dark.svg");
- --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-dark.svg");
- }
-}
-
-#letterboxingAligner .letterboxing-align-top img {
- content: var(--letterboxing-alignment-img-top);
-}
-#letterboxingAligner .letterboxing-align-middle img {
- content: var(--letterboxing-alignment-img-middle);
-}
-
-#letterboxingAligner label {
- width: 200px;
- flex: 0 0 auto;
-}
-
-#letterboxingAligner img {
- border: none;
- box-shadow: none;
-}
-
-/* Hide letterboxing options depending on whether ResistFingerprinting or
- * Letterboxing is enabled. */
-#letterboxingCategory:not(.rfp-enabled),
-#letterboxingCategory:not(.rfp-enabled) ~ #letterboxingDisabled,
-#letterboxingCategory.letterboxing-enabled ~ #letterboxingDisabled,
-#letterboxingCategory:not(.rfp-enabled.letterboxing-enabled) ~ .letterboxing-category {
+#letterboxingCategory.hide-all-letterboxing {
display: none;
}
-/* We duplicate the Letterboxing overview to appear in search results.
- * We want to hide them whenever they are *not* part of a search result. */
-:is(
- /* Hide the duplicates when the category is *not* hidden. */
- #letterboxingCategory:not(.visually-hidden) ~ .letterboxing-category,
- /* Also hide the duplicated overview for subsequence search results if a
- * previous groupbox is *not* hidden. */
- .letterboxing-category:not(.visually-hidden) ~ .letterboxing-category,
-) .letterboxing-search-overview {
- display: none;
+.letterboxing-overview {
+ margin-block-end: var(--space-xxlarge);
}
-/* Similarly for #letterboxingDisabled, but we also want to hide its
- * "Letterboxing" heading.
- * NOTE: This should only appear in isolation, so we do not need to worry about
- * subsequent groupboxes. */
-#letterboxingCategory:not(.visually-hidden) ~ #letterboxingDisabled :is(.letterboxing-search-heading, .letterboxing-search-overview) {
- display: none;
+.letterboxing-chooser-item.appearance-chooser-item {
+ flex: 0 1 200px;
}
=====================================
browser/components/preferences/letterboxing.inc.xhtml
=====================================
@@ -15,100 +15,12 @@
></html:a>
</description>
</vbox>
-<groupbox
- class="letterboxing-category"
- data-category="paneGeneral"
- hidden="true"
->
- <label><html:h2
- data-l10n-id="letterboxing-window-size-header"/></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <checkbox
- id="letterboxingRememberSize"
- data-l10n-id="letterboxing-remember-size"
- preference="privacy.resistFingerprinting.letterboxing.rememberSize"
- />
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingDisabled"></html:setting-group>
</groupbox>
-<groupbox
- class="letterboxing-category"
- data-category="paneGeneral"
- hidden="true"
->
- <label><html:h2
- data-l10n-id="letterboxing-alignment-header"
- /></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <description
- id="letterboxingAlignmentDesc"
- flex="1"
- data-l10n-id="letterboxing-alignment-description"
- />
- <form
- xmlns="http://www.w3.org/1999/xhtml"
- id="letterboxingAligner"
- autocomplete="off"
- aria-labelledby="letterboxingAlignmentDesc"
- >
- <label class="web-appearance-choice letterboxing-align-top">
- <div class="web-appearance-choice-image-container">
- <img role="presentation" />
- </div>
- <div class="web-appearance-choice-footer">
- <input type="radio" name="alignment" value="top" />
- <span data-l10n-id="letterboxing-alignment-top"></span>
- </div>
- </label>
- <label class="web-appearance-choice letterboxing-align-middle">
- <div class="web-appearance-choice-image-container">
- <img role="presentation" />
- </div>
- <div class="web-appearance-choice-footer">
- <input type="radio" name="alignment" value="middle" />
- <span data-l10n-id="letterboxing-alignment-middle"></span>
- </div>
- </label>
- </form>
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingSize"></html:setting-group>
</groupbox>
-<groupbox
- id="letterboxingDisabled"
- data-category="paneGeneral"
- hidden="true"
->
- <label class="letterboxing-search-heading"><html:h2
- data-l10n-id="letterboxing-header"/></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <hbox align="center">
- <label
- class="face-sad"
- flex="1"
- data-l10n-id="letterboxing-disabled-description"
- />
- <button
- id="letterboxingEnableButton"
- class="accessory-button"
- is="highlightable-button"
- data-l10n-id="letterboxing-enable-button"
- />
- </hbox>
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingAlignment"></html:setting-group>
</groupbox>
=====================================
browser/components/preferences/letterboxing.js
=====================================
@@ -1,112 +1,155 @@
-/* import-globals-from /browser/components/preferences/preferences.js */
-/* import-globals-from /browser/components/preferences/findInPage.js */
-/* import-globals-from /toolkit/content/preferencesBindings.js */
+/* import-globals-from preferences.js */
+/* import-globals-from findInPage.js */
Preferences.addAll([
+ {
+ id: "privacy.resistFingerprinting.letterboxing",
+ type: "bool",
+ },
{
id: "privacy.resistFingerprinting.letterboxing.rememberSize",
type: "bool",
},
+ {
+ id: "privacy.resistFingerprinting.letterboxing.vcenter",
+ type: "bool",
+ },
]);
-{
- const lbEnabledPref = "privacy.resistFingerprinting.letterboxing";
- const visibilityPrefs = ["privacy.resistFingerprinting", lbEnabledPref];
- const alignMiddlePref = "privacy.resistFingerprinting.letterboxing.vcenter";
+Preferences.addSetting({
+ id: "letterboxingEnabled",
+ pref: "privacy.resistFingerprinting.letterboxing",
+});
- const hideFromSearchIf = (mustHide, ...elements) => {
- for (const element of elements) {
- if (mustHide) {
- element.setAttribute("data-hidden-from-search", "true");
- } else {
- element.removeAttribute("data-hidden-from-search");
- }
- }
- };
-
- const syncVisibility = () => {
- const [rfpEnabled, letterboxingEnabled] = visibilityPrefs.map(pref =>
- Services.prefs.getBoolPref(pref, false)
- );
- const categoryElement = document.getElementById("letterboxingCategory");
- const { classList } = categoryElement;
-
- // Show the letterboxing section only if resistFingerprinting is enabled
- classList.toggle("rfp-enabled", rfpEnabled);
- classList.toggle("letterboxing-enabled", letterboxingEnabled);
+Preferences.addSetting({
+ id: "letterboxingRememberSize",
+ pref: "privacy.resistFingerprinting.letterboxing.rememberSize",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return letterboxingEnabled.value && resistFingerprinting.value;
+ },
+});
- // To ensure the hidden parts do not contribute to search results, we need
- // to add "data-hidden-from-search".
- hideFromSearchIf(
- !rfpEnabled || !letterboxingEnabled,
- ...document.querySelectorAll(".letterboxing-category")
- );
- hideFromSearchIf(
- !rfpEnabled || letterboxingEnabled,
- document.getElementById("letterboxingDisabled")
- );
- };
+Preferences.addSetting({
+ id: "letterboxingContentAlignment",
+ pref: "privacy.resistFingerprinting.letterboxing.vcenter",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return letterboxingEnabled.value && resistFingerprinting.value;
+ },
+ get: val => {
+ return val ? "middle" : "top";
+ },
+ set: val => {
+ return val == "middle";
+ },
+});
- const onVisibilityPrefChange = () => {
- syncVisibility();
- // NOTE: Firefox does not expect "data-hidden-from-search" to change
- // dynamically after page initialization. So we need to manually recall the
- // methods that use "data-hidden-from-search". I.e. the "search" method,
- // using the currently shown category.
- // NOTE: We skip this if we are just initializing on page load.
- // NOTE: data-hidden-from-search is also used when the user has entered a
- // search term. We do not update the results in this case. Instead, it will
- // update when the search term changes or is cleared.
- if (!gSearchResultsPane.query) {
- search(gLastCategory.category, "data-category");
+Preferences.addSetting({
+ id: "letterboxingShouldEnable",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return !letterboxingEnabled.value && resistFingerprinting.value;
+ },
+ onUserClick: (e, { letterboxingEnabled }) => {
+ const buttonEl = document.getElementById("enableLetterboxingButton");
+ if (!buttonEl?.contains(e.target)) {
+ return;
}
- };
-
- const alignerId = "letterboxingAligner";
- const syncAligner = () => {
- const value = Services.prefs.getBoolPref(alignMiddlePref)
- ? "middle"
- : "top";
- document.querySelector(`#${alignerId} input[value="${value}"]`).checked =
- true;
- };
-
- var gLetterboxingPrefs = {
- init() {
- syncVisibility();
- document
- .getElementById("letterboxingEnableButton")
- .addEventListener("command", () => {
- Services.prefs.setBoolPref(lbEnabledPref, true);
- // Button should have focus when activated but will be hidden now,
- // so re-assign focus to the newly revealed options.
- Services.focus.moveFocus(
- window,
- document.querySelector(".letterboxing-category"),
- Services.focus.MOVEFOCUS_FIRST,
- 0
- );
- });
- for (const pref of visibilityPrefs) {
- Services.prefs.addObserver(pref, onVisibilityPrefChange);
+ letterboxingEnabled.value = true;
+ setTimeout(() => {
+ // Need to re-search to remove the "hidden" attribute on the groupbox
+ // elements (after the data-hidden-from-search attributes are changed by
+ // the "visible" callback).
+ // TODO: Is this an upstream issue that "hidden" is not removed?
+ if (!gSearchResultsPane.query) {
+ search(gLastCategory.category, "data-category");
}
+ // Button should have focus when activated but will be hidden now,
+ // so re-assign focus to the newly revealed options.
+ Services.focus.moveFocus(
+ window,
+ buttonEl,
+ Services.focus.MOVEFOCUS_FORWARD,
+ 0
+ );
+ });
+ },
+});
- syncAligner();
- document.getElementById(alignerId).addEventListener("change", e => {
- // NOTE: the "change" event is only fired on the checked input.
- Services.prefs.setBoolPref(
- alignMiddlePref,
- e.target.value === "middle"
- );
- });
- Services.prefs.addObserver(alignMiddlePref, syncAligner);
- },
+SettingGroupManager.registerGroups({
+ letterboxingDisabled: {
+ items: [
+ {
+ id: "letterboxingShouldEnable",
+ l10nId: "letterboxing-disabled-message",
+ control: "moz-promo",
+ options: [
+ {
+ control: "moz-button",
+ l10nId: "letterboxing-enable-button",
+ id: "enableLetterboxingButton",
+ slot: "actions",
+ },
+ ],
+ },
+ ],
+ },
+ letterboxingSize: {
+ l10nId: "letterboxing-window-size-group",
+ headingLevel: 2,
+ items: [
+ {
+ id: "letterboxingRememberSize",
+ l10nId: "letterboxing-remember-size",
+ control: "moz-checkbox",
+ },
+ ],
+ },
+ letterboxingAlignment: {
+ l10nId: "letterboxing-alignment-group",
+ headingLevel: 2,
+ items: [
+ {
+ id: "letterboxingContentAlignment",
+ control: "moz-visual-picker",
+ options: [
+ {
+ value: "top",
+ l10nId: "letterboxing-alignment-top-option",
+ controlAttrs: {
+ class: "appearance-chooser-item letterboxing-chooser-item",
+ imagesrc:
+ "chrome://browser/content/preferences/letterboxing-top.svg",
+ },
+ },
+ {
+ value: "middle",
+ l10nId: "letterboxing-alignment-middle-option",
+ controlAttrs: {
+ class: "appearance-chooser-item letterboxing-chooser-item",
+ imagesrc:
+ "chrome://browser/content/preferences/letterboxing-middle.svg",
+ },
+ },
+ ],
+ },
+ ],
+ },
+});
- destroy() {
- for (const pref of visibilityPrefs) {
- Services.prefs.removeObserver(pref, onVisibilityPrefChange);
- }
- Services.prefs.removeObserver(alignMiddlePref, syncAligner);
- },
- };
-}
+var gLetterboxingPrefs = {
+ init() {
+ const rfpSetting = Preferences.getSetting("resistFingerprinting");
+ const updateCategoryVisibility = () => {
+ document
+ .getElementById("letterboxingCategory")
+ .classList.toggle("hide-all-letterboxing", !rfpSetting.value);
+ };
+ rfpSetting.on("change", updateCategoryVisibility);
+ updateCategoryVisibility();
+ initSettingGroup("letterboxingDisabled");
+ initSettingGroup("letterboxingSize");
+ initSettingGroup("letterboxingAlignment");
+ },
+};
=====================================
browser/components/preferences/main.js
=====================================
@@ -5013,8 +5013,6 @@ var gMainPane = {
this._translationsView.destroy();
this._translationsView = null;
}
-
- gLetterboxingPrefs.destroy();
},
// nsISupports
=====================================
toolkit/locales/en-US/toolkit/global/base-browser.ftl
=====================================
@@ -81,17 +81,22 @@ letterboxing-header = Letterboxing
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
letterboxing-overview = { -brand-short-name }'s Letterboxing feature restricts websites to display at specific sizes, making it harder to single out users on the basis of their window or screen size.
letterboxing-learn-more = Learn more
-letterboxing-window-size-header = Window size
+letterboxing-window-size-group =
+ .label = Window size
letterboxing-remember-size =
.label = Reuse last window size when opening a new window
.accesskey = R
-letterboxing-alignment-header = Content alignment
-letterboxing-alignment-description = Choose where you want to align the website’s content.
-letterboxing-alignment-top = Top
-letterboxing-alignment-middle = Middle
+letterboxing-alignment-group =
+ .label = Content alignment
+ .description = Choose where you want to align the website’s content.
+letterboxing-alignment-top-option =
+ .label = Top
+letterboxing-alignment-middle-option =
+ .label = Middle
# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
-letterboxing-disabled-description = Letterboxing is currently disabled.
+letterboxing-disabled-message =
+ .message = Letterboxing is currently disabled.
# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
letterboxing-enable-button =
=====================================
tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
=====================================
@@ -0,0 +1,24 @@
+from fluent.migrate.helpers import transforms_from
+
+
+def migrate(ctx):
+ ctx.add_transforms(
+ "base-browser.ftl",
+ "base-browser.ftl",
+ transforms_from(
+ """
+letterboxing-window-size-group =
+ .label = { COPY_PATTERN(path, "letterboxing-window-size-header") }
+letterboxing-alignment-group =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-header") }
+ .description = { COPY_PATTERN(path, "letterboxing-alignment-description") }
+letterboxing-alignment-top-option =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-top") }
+letterboxing-alignment-middle-option =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-middle") }
+letterboxing-disabled-message =
+ .message = { COPY_PATTERN(path, "letterboxing-disabled-description") }
+""",
+ path="base-browser.ftl",
+ ),
+ )
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/5494b6…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/5494b6…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser][tor-browser-147.0a1-16.0-2] 3 commits: fixup! BB 41916: Letterboxing preferences UI
by henry (@henry) 12 Feb '26
by henry (@henry) 12 Feb '26
12 Feb '26
henry pushed to branch tor-browser-147.0a1-16.0-2 at The Tor Project / Applications / Tor Browser
Commits:
b529d57f by Henry Wilkes at 2026-02-12T18:06:33+00:00
fixup! BB 41916: Letterboxing preferences UI
TB 44459: Use settings config for Letterboxing.
- - - - -
0b979649 by Henry Wilkes at 2026-02-12T18:06:33+00:00
fixup! Base Browser strings
TB 44459: Convert letterboxing setting strings.
- - - - -
d70fc64b by Henry Wilkes at 2026-02-12T18:06:33+00:00
fixup! Tor Browser localization migration scripts.
TB 44459: Migration recipe to create the new letterboxing strings for
other locales.
- - - - -
13 changed files:
- browser/components/preferences/jar.mn
- − browser/components/preferences/letterboxing-middle-dark.svg
- − browser/components/preferences/letterboxing-middle-light.svg
- + browser/components/preferences/letterboxing-middle.svg
- − browser/components/preferences/letterboxing-top-dark.svg
- − browser/components/preferences/letterboxing-top-light.svg
- + browser/components/preferences/letterboxing-top.svg
- browser/components/preferences/letterboxing.css
- browser/components/preferences/letterboxing.inc.xhtml
- browser/components/preferences/letterboxing.js
- browser/components/preferences/main.js
- toolkit/locales/en-US/toolkit/global/base-browser.ftl
- + tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
Changes:
=====================================
browser/components/preferences/jar.mn
=====================================
@@ -45,7 +45,5 @@ browser.jar:
content/browser/preferences/letterboxing.js
content/browser/preferences/letterboxing.css
- content/browser/preferences/letterboxing-middle-dark.svg
- content/browser/preferences/letterboxing-middle-light.svg
- content/browser/preferences/letterboxing-top-dark.svg
- content/browser/preferences/letterboxing-top-light.svg
+ content/browser/preferences/letterboxing-middle.svg
+ content/browser/preferences/letterboxing-top.svg
=====================================
browser/components/preferences/letterboxing-middle-dark.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_2272_529)">
-<g clip-path="url(#clip0_2272_529)">
-<path d="M58 3H4V45H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="white"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="white"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="white"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="white"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="white"/>
-<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
-<rect x="8" y="18" width="46" height="23" rx="2" fill="#3A3944"/>
-<path d="M38 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H38C38.5523 24 39 23.5523 39 23C39 22.4477 38.5523 22 38 22Z" fill="white"/>
-<path d="M27 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H27C27.5523 28 28 27.5523 28 27C28 26.4477 27.5523 26 27 26Z" fill="white"/>
-<path d="M42 30H13C12.4477 30 12 30.4477 12 31C12 31.5523 12.4477 32 13 32H42C42.5523 32 43 31.5523 43 31C43 30.4477 42.5523 30 42 30Z" fill="white"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_2272_529" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_529"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_529" result="shape"/>
-</filter>
-<clipPath id="clip0_2272_529">
-<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-middle-light.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_202_960)">
-<g clip-path="url(#clip0_202_960)">
-<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="#52525E"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="#52525E"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="#52525E"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="#52525E"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="#52525E"/>
-<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
-<rect x="8" y="18" width="46" height="23" rx="2" fill="white"/>
-<path d="M38 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H38C38.5523 24 39 23.5523 39 23C39 22.4477 38.5523 22 38 22Z" fill="#52525E"/>
-<path d="M27 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H27C27.5523 28 28 27.5523 28 27C28 26.4477 27.5523 26 27 26Z" fill="#52525E"/>
-<path d="M42 30H13C12.4477 30 12 30.4477 12 31C12 31.5523 12.4477 32 13 32H42C42.5523 32 43 31.5523 43 31C43 30.4477 42.5523 30 42 30Z" fill="#52525E"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_202_960" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_960"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_960" result="shape"/>
-</filter>
-<clipPath id="clip0_202_960">
-<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-middle.svg
=====================================
@@ -0,0 +1,20 @@
+<svg width="54" height="42" xmlns="http://www.w3.org/2000/svg">
+<rect width="54" height="42" fill="light-dark(#CFCFD8, #5B5B66)"/>
+<rect width="54" height="11" fill="light-dark(#F0F0F4, #42414D)"/>
+<rect width="54" height="5" fill="light-dark(#E0E0E6, #2B2A33)"/>
+<g fill="light-dark(#52525E, white)">
+ <rect x="5" y="2" width="12" height="2" rx="1"/>
+ <rect x="50" y="7" width="2" height="2" rx="1"/>
+ <rect x="2" y="7" width="2" height="2" rx="1"/>
+ <rect x="6" y="7" width="2" height="2" rx="1"/>
+ <rect x="10" y="7" width="38" height="2" rx="1"/>
+</g>
+<g fill="light-dark(white, #3A3944)">
+ <rect x="4" y="15" width="46" height="23" rx="2"/>
+</g>
+<g fill="light-dark(#52525E, white)">
+ <rect x="8" y="19" width="27" height="2" rx="1"/>
+ <rect x="8" y="23" width="16" height="2" rx="1"/>
+ <rect x="8" y="27" width="31" height="2" rx="1"/>
+</g>
+</svg>
=====================================
browser/components/preferences/letterboxing-top-dark.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_2272_508)">
-<g clip-path="url(#clip0_2272_508)">
-<path d="M58 3H4V45H58V3Z" fill="#52525E"/>
-<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
-<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="white"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="white"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="white"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="white"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="white"/>
-<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
-<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="#3A3944"/>
-<path d="M38 18H13C12.4477 18 12 18.4477 12 19C12 19.5523 12.4477 20 13 20H38C38.5523 20 39 19.5523 39 19C39 18.4477 38.5523 18 38 18Z" fill="white"/>
-<path d="M27 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H27C27.5523 24 28 23.5523 28 23C28 22.4477 27.5523 22 27 22Z" fill="white"/>
-<path d="M42 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H42C42.5523 28 43 27.5523 43 27C43 26.4477 42.5523 26 42 26Z" fill="white"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_2272_508" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_508"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_508" result="shape"/>
-</filter>
-<clipPath id="clip0_2272_508">
-<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-top-light.svg deleted
=====================================
@@ -1,35 +0,0 @@
-<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<g filter="url(#filter0_d_202_926)">
-<g clip-path="url(#clip0_202_926)">
-<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
-<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
-<path d="M20 5H10C9.44772 5 9 5.44772 9 6C9 6.55228 9.44772 7 10 7H20C20.5523 7 21 6.55228 21 6C21 5.44772 20.5523 5 20 5Z" fill="#52525E"/>
-<path d="M56 11C56 10.4477 55.5523 10 55 10C54.4477 10 54 10.4477 54 11C54 11.5523 54.4477 12 55 12C55.5523 12 56 11.5523 56 11Z" fill="#52525E"/>
-<path d="M8 11C8 10.4477 7.55228 10 7 10C6.44772 10 6 10.4477 6 11C6 11.5523 6.44772 12 7 12C7.55228 12 8 11.5523 8 11Z" fill="#52525E"/>
-<path d="M12 11C12 10.4477 11.5523 10 11 10C10.4477 10 10 10.4477 10 11C10 11.5523 10.4477 12 11 12C11.5523 12 12 11.5523 12 11Z" fill="#52525E"/>
-<path d="M51 10H15C14.4477 10 14 10.4477 14 11C14 11.5523 14.4477 12 15 12H51C51.5523 12 52 11.5523 52 11C52 10.4477 51.5523 10 51 10Z" fill="#52525E"/>
-<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
-<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="white"/>
-<path d="M38 18H13C12.4477 18 12 18.4477 12 19C12 19.5523 12.4477 20 13 20H38C38.5523 20 39 19.5523 39 19C39 18.4477 38.5523 18 38 18Z" fill="#52525E"/>
-<path d="M27 22H13C12.4477 22 12 22.4477 12 23C12 23.5523 12.4477 24 13 24H27C27.5523 24 28 23.5523 28 23C28 22.4477 27.5523 22 27 22Z" fill="#52525E"/>
-<path d="M42 26H13C12.4477 26 12 26.4477 12 27C12 27.5523 12.4477 28 13 28H42C42.5523 28 43 27.5523 43 27C43 26.4477 42.5523 26 42 26Z" fill="#52525E"/>
-</g>
-<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
-</g>
-<defs>
-<filter id="filter0_d_202_926" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
-<feFlood flood-opacity="0" result="BackgroundImageFix"/>
-<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
-<feOffset dy="1"/>
-<feGaussianBlur stdDeviation="2"/>
-<feComposite in2="hardAlpha" operator="out"/>
-<feColorMatrix type="matrix" values="0 0 0 0 0.0470588 0 0 0 0 0.0470588 0 0 0 0 0.0509804 0 0 0 0.1 0"/>
-<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_926"/>
-<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_926" result="shape"/>
-</filter>
-<clipPath id="clip0_202_926">
-<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
-</clipPath>
-</defs>
-</svg>
=====================================
browser/components/preferences/letterboxing-top.svg
=====================================
@@ -0,0 +1,21 @@
+<svg width="54" height="42" xmlns="http://www.w3.org/2000/svg">
+<rect width="54" height="42" fill="light-dark(#CFCFD8, #5B5B66)"/>
+<rect width="54" height="11" fill="light-dark(#F0F0F4, #42414D)"/>
+<rect width="54" height="5" fill="light-dark(#E0E0E6, #2B2A33)"/>
+<g fill="light-dark(#52525E, white)">
+ <rect x="5" y="2" width="12" height="2" rx="1"/>
+ <rect x="50" y="7" width="2" height="2" rx="1"/>
+ <rect x="2" y="7" width="2" height="2" rx="1"/>
+ <rect x="6" y="7" width="2" height="2" rx="1"/>
+ <rect x="10" y="7" width="38" height="2" rx="1"/>
+</g>
+<g fill="light-dark(white, #3A3944)">
+ <rect x="4" y="11" width="46" height="27" rx="2"/>
+ <rect x="4" y="11" width="46" height="4"/>
+</g>
+<g fill="light-dark(#52525E, white)">
+ <rect x="8" y="15" width="27" height="2" rx="1"/>
+ <rect x="8" y="19" width="16" height="2" rx="1"/>
+ <rect x="8" y="23" width="31" height="2" rx="1"/>
+</g>
+</svg>
=====================================
browser/components/preferences/letterboxing.css
=====================================
@@ -1,69 +1,11 @@
-.letterboxing-overview {
- margin-block-end: 32px;
-}
-
-.letterboxing-search-overview {
- margin-block-end: 16px;
-}
-#letterboxingAligner {
- display: flex;
- justify-content: start;
- gap: 16px;
- margin-block: 12px;
-
- --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-light.svg");
- --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-light.svg");
-}
-
-@media (prefers-color-scheme: dark) {
- #letterboxingAligner {
- --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-dark.svg");
- --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-dark.svg");
- }
-}
-
-#letterboxingAligner .letterboxing-align-top img {
- content: var(--letterboxing-alignment-img-top);
-}
-#letterboxingAligner .letterboxing-align-middle img {
- content: var(--letterboxing-alignment-img-middle);
-}
-
-#letterboxingAligner label {
- width: 200px;
- flex: 0 0 auto;
-}
-
-#letterboxingAligner img {
- border: none;
- box-shadow: none;
-}
-
-/* Hide letterboxing options depending on whether ResistFingerprinting or
- * Letterboxing is enabled. */
-#letterboxingCategory:not(.rfp-enabled),
-#letterboxingCategory:not(.rfp-enabled) ~ #letterboxingDisabled,
-#letterboxingCategory.letterboxing-enabled ~ #letterboxingDisabled,
-#letterboxingCategory:not(.rfp-enabled.letterboxing-enabled) ~ .letterboxing-category {
+#letterboxingCategory.hide-all-letterboxing {
display: none;
}
-/* We duplicate the Letterboxing overview to appear in search results.
- * We want to hide them whenever they are *not* part of a search result. */
-:is(
- /* Hide the duplicates when the category is *not* hidden. */
- #letterboxingCategory:not(.visually-hidden) ~ .letterboxing-category,
- /* Also hide the duplicated overview for subsequence search results if a
- * previous groupbox is *not* hidden. */
- .letterboxing-category:not(.visually-hidden) ~ .letterboxing-category,
-) .letterboxing-search-overview {
- display: none;
+.letterboxing-overview {
+ margin-block-end: var(--space-xxlarge);
}
-/* Similarly for #letterboxingDisabled, but we also want to hide its
- * "Letterboxing" heading.
- * NOTE: This should only appear in isolation, so we do not need to worry about
- * subsequent groupboxes. */
-#letterboxingCategory:not(.visually-hidden) ~ #letterboxingDisabled :is(.letterboxing-search-heading, .letterboxing-search-overview) {
- display: none;
+.letterboxing-chooser-item.appearance-chooser-item {
+ flex: 0 1 200px;
}
=====================================
browser/components/preferences/letterboxing.inc.xhtml
=====================================
@@ -15,100 +15,12 @@
></html:a>
</description>
</vbox>
-<groupbox
- class="letterboxing-category"
- data-category="paneGeneral"
- hidden="true"
->
- <label><html:h2
- data-l10n-id="letterboxing-window-size-header"/></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <checkbox
- id="letterboxingRememberSize"
- data-l10n-id="letterboxing-remember-size"
- preference="privacy.resistFingerprinting.letterboxing.rememberSize"
- />
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingDisabled"></html:setting-group>
</groupbox>
-<groupbox
- class="letterboxing-category"
- data-category="paneGeneral"
- hidden="true"
->
- <label><html:h2
- data-l10n-id="letterboxing-alignment-header"
- /></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <description
- id="letterboxingAlignmentDesc"
- flex="1"
- data-l10n-id="letterboxing-alignment-description"
- />
- <form
- xmlns="http://www.w3.org/1999/xhtml"
- id="letterboxingAligner"
- autocomplete="off"
- aria-labelledby="letterboxingAlignmentDesc"
- >
- <label class="web-appearance-choice letterboxing-align-top">
- <div class="web-appearance-choice-image-container">
- <img role="presentation" />
- </div>
- <div class="web-appearance-choice-footer">
- <input type="radio" name="alignment" value="top" />
- <span data-l10n-id="letterboxing-alignment-top"></span>
- </div>
- </label>
- <label class="web-appearance-choice letterboxing-align-middle">
- <div class="web-appearance-choice-image-container">
- <img role="presentation" />
- </div>
- <div class="web-appearance-choice-footer">
- <input type="radio" name="alignment" value="middle" />
- <span data-l10n-id="letterboxing-alignment-middle"></span>
- </div>
- </label>
- </form>
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingSize"></html:setting-group>
</groupbox>
-<groupbox
- id="letterboxingDisabled"
- data-category="paneGeneral"
- hidden="true"
->
- <label class="letterboxing-search-heading"><html:h2
- data-l10n-id="letterboxing-header"/></label>
- <description class="letterboxing-search-overview description-deemphasized">
- <html:span data-l10n-id="letterboxing-overview"></html:span>
- <html:a
- is="moz-support-link"
- tor-manual-page="anti-fingerprinting_letterboxing"
- data-l10n-id="letterboxing-learn-more"
- ></html:a>
- </description>
- <hbox align="center">
- <label
- class="face-sad"
- flex="1"
- data-l10n-id="letterboxing-disabled-description"
- />
- <button
- id="letterboxingEnableButton"
- class="accessory-button"
- is="highlightable-button"
- data-l10n-id="letterboxing-enable-button"
- />
- </hbox>
+<groupbox data-category="paneGeneral" hidden="true">
+ <html:setting-group groupid="letterboxingAlignment"></html:setting-group>
</groupbox>
=====================================
browser/components/preferences/letterboxing.js
=====================================
@@ -1,112 +1,155 @@
-/* import-globals-from /browser/components/preferences/preferences.js */
-/* import-globals-from /browser/components/preferences/findInPage.js */
-/* import-globals-from /toolkit/content/preferencesBindings.js */
+/* import-globals-from preferences.js */
+/* import-globals-from findInPage.js */
Preferences.addAll([
+ {
+ id: "privacy.resistFingerprinting.letterboxing",
+ type: "bool",
+ },
{
id: "privacy.resistFingerprinting.letterboxing.rememberSize",
type: "bool",
},
+ {
+ id: "privacy.resistFingerprinting.letterboxing.vcenter",
+ type: "bool",
+ },
]);
-{
- const lbEnabledPref = "privacy.resistFingerprinting.letterboxing";
- const visibilityPrefs = ["privacy.resistFingerprinting", lbEnabledPref];
- const alignMiddlePref = "privacy.resistFingerprinting.letterboxing.vcenter";
+Preferences.addSetting({
+ id: "letterboxingEnabled",
+ pref: "privacy.resistFingerprinting.letterboxing",
+});
- const hideFromSearchIf = (mustHide, ...elements) => {
- for (const element of elements) {
- if (mustHide) {
- element.setAttribute("data-hidden-from-search", "true");
- } else {
- element.removeAttribute("data-hidden-from-search");
- }
- }
- };
-
- const syncVisibility = () => {
- const [rfpEnabled, letterboxingEnabled] = visibilityPrefs.map(pref =>
- Services.prefs.getBoolPref(pref, false)
- );
- const categoryElement = document.getElementById("letterboxingCategory");
- const { classList } = categoryElement;
-
- // Show the letterboxing section only if resistFingerprinting is enabled
- classList.toggle("rfp-enabled", rfpEnabled);
- classList.toggle("letterboxing-enabled", letterboxingEnabled);
+Preferences.addSetting({
+ id: "letterboxingRememberSize",
+ pref: "privacy.resistFingerprinting.letterboxing.rememberSize",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return letterboxingEnabled.value && resistFingerprinting.value;
+ },
+});
- // To ensure the hidden parts do not contribute to search results, we need
- // to add "data-hidden-from-search".
- hideFromSearchIf(
- !rfpEnabled || !letterboxingEnabled,
- ...document.querySelectorAll(".letterboxing-category")
- );
- hideFromSearchIf(
- !rfpEnabled || letterboxingEnabled,
- document.getElementById("letterboxingDisabled")
- );
- };
+Preferences.addSetting({
+ id: "letterboxingContentAlignment",
+ pref: "privacy.resistFingerprinting.letterboxing.vcenter",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return letterboxingEnabled.value && resistFingerprinting.value;
+ },
+ get: val => {
+ return val ? "middle" : "top";
+ },
+ set: val => {
+ return val == "middle";
+ },
+});
- const onVisibilityPrefChange = () => {
- syncVisibility();
- // NOTE: Firefox does not expect "data-hidden-from-search" to change
- // dynamically after page initialization. So we need to manually recall the
- // methods that use "data-hidden-from-search". I.e. the "search" method,
- // using the currently shown category.
- // NOTE: We skip this if we are just initializing on page load.
- // NOTE: data-hidden-from-search is also used when the user has entered a
- // search term. We do not update the results in this case. Instead, it will
- // update when the search term changes or is cleared.
- if (!gSearchResultsPane.query) {
- search(gLastCategory.category, "data-category");
+Preferences.addSetting({
+ id: "letterboxingShouldEnable",
+ deps: ["letterboxingEnabled", "resistFingerprinting"],
+ visible: ({ letterboxingEnabled, resistFingerprinting }) => {
+ return !letterboxingEnabled.value && resistFingerprinting.value;
+ },
+ onUserClick: (e, { letterboxingEnabled }) => {
+ const buttonEl = document.getElementById("enableLetterboxingButton");
+ if (!buttonEl?.contains(e.target)) {
+ return;
}
- };
-
- const alignerId = "letterboxingAligner";
- const syncAligner = () => {
- const value = Services.prefs.getBoolPref(alignMiddlePref)
- ? "middle"
- : "top";
- document.querySelector(`#${alignerId} input[value="${value}"]`).checked =
- true;
- };
-
- var gLetterboxingPrefs = {
- init() {
- syncVisibility();
- document
- .getElementById("letterboxingEnableButton")
- .addEventListener("command", () => {
- Services.prefs.setBoolPref(lbEnabledPref, true);
- // Button should have focus when activated but will be hidden now,
- // so re-assign focus to the newly revealed options.
- Services.focus.moveFocus(
- window,
- document.querySelector(".letterboxing-category"),
- Services.focus.MOVEFOCUS_FIRST,
- 0
- );
- });
- for (const pref of visibilityPrefs) {
- Services.prefs.addObserver(pref, onVisibilityPrefChange);
+ letterboxingEnabled.value = true;
+ setTimeout(() => {
+ // Need to re-search to remove the "hidden" attribute on the groupbox
+ // elements (after the data-hidden-from-search attributes are changed by
+ // the "visible" callback).
+ // TODO: Is this an upstream issue that "hidden" is not removed?
+ if (!gSearchResultsPane.query) {
+ search(gLastCategory.category, "data-category");
}
+ // Button should have focus when activated but will be hidden now,
+ // so re-assign focus to the newly revealed options.
+ Services.focus.moveFocus(
+ window,
+ buttonEl,
+ Services.focus.MOVEFOCUS_FORWARD,
+ 0
+ );
+ });
+ },
+});
- syncAligner();
- document.getElementById(alignerId).addEventListener("change", e => {
- // NOTE: the "change" event is only fired on the checked input.
- Services.prefs.setBoolPref(
- alignMiddlePref,
- e.target.value === "middle"
- );
- });
- Services.prefs.addObserver(alignMiddlePref, syncAligner);
- },
+SettingGroupManager.registerGroups({
+ letterboxingDisabled: {
+ items: [
+ {
+ id: "letterboxingShouldEnable",
+ l10nId: "letterboxing-disabled-message",
+ control: "moz-promo",
+ options: [
+ {
+ control: "moz-button",
+ l10nId: "letterboxing-enable-button",
+ id: "enableLetterboxingButton",
+ slot: "actions",
+ },
+ ],
+ },
+ ],
+ },
+ letterboxingSize: {
+ l10nId: "letterboxing-window-size-group",
+ headingLevel: 2,
+ items: [
+ {
+ id: "letterboxingRememberSize",
+ l10nId: "letterboxing-remember-size",
+ control: "moz-checkbox",
+ },
+ ],
+ },
+ letterboxingAlignment: {
+ l10nId: "letterboxing-alignment-group",
+ headingLevel: 2,
+ items: [
+ {
+ id: "letterboxingContentAlignment",
+ control: "moz-visual-picker",
+ options: [
+ {
+ value: "top",
+ l10nId: "letterboxing-alignment-top-option",
+ controlAttrs: {
+ class: "appearance-chooser-item letterboxing-chooser-item",
+ imagesrc:
+ "chrome://browser/content/preferences/letterboxing-top.svg",
+ },
+ },
+ {
+ value: "middle",
+ l10nId: "letterboxing-alignment-middle-option",
+ controlAttrs: {
+ class: "appearance-chooser-item letterboxing-chooser-item",
+ imagesrc:
+ "chrome://browser/content/preferences/letterboxing-middle.svg",
+ },
+ },
+ ],
+ },
+ ],
+ },
+});
- destroy() {
- for (const pref of visibilityPrefs) {
- Services.prefs.removeObserver(pref, onVisibilityPrefChange);
- }
- Services.prefs.removeObserver(alignMiddlePref, syncAligner);
- },
- };
-}
+var gLetterboxingPrefs = {
+ init() {
+ const rfpSetting = Preferences.getSetting("resistFingerprinting");
+ const updateCategoryVisibility = () => {
+ document
+ .getElementById("letterboxingCategory")
+ .classList.toggle("hide-all-letterboxing", !rfpSetting.value);
+ };
+ rfpSetting.on("change", updateCategoryVisibility);
+ updateCategoryVisibility();
+ initSettingGroup("letterboxingDisabled");
+ initSettingGroup("letterboxingSize");
+ initSettingGroup("letterboxingAlignment");
+ },
+};
=====================================
browser/components/preferences/main.js
=====================================
@@ -5017,8 +5017,6 @@ var gMainPane = {
this._translationsView.destroy();
this._translationsView = null;
}
-
- gLetterboxingPrefs.destroy();
},
// nsISupports
=====================================
toolkit/locales/en-US/toolkit/global/base-browser.ftl
=====================================
@@ -81,17 +81,22 @@ letterboxing-header = Letterboxing
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
letterboxing-overview = { -brand-short-name }'s Letterboxing feature restricts websites to display at specific sizes, making it harder to single out users on the basis of their window or screen size.
letterboxing-learn-more = Learn more
-letterboxing-window-size-header = Window size
+letterboxing-window-size-group =
+ .label = Window size
letterboxing-remember-size =
.label = Reuse last window size when opening a new window
.accesskey = R
-letterboxing-alignment-header = Content alignment
-letterboxing-alignment-description = Choose where you want to align the website’s content.
-letterboxing-alignment-top = Top
-letterboxing-alignment-middle = Middle
+letterboxing-alignment-group =
+ .label = Content alignment
+ .description = Choose where you want to align the website’s content.
+letterboxing-alignment-top-option =
+ .label = Top
+letterboxing-alignment-middle-option =
+ .label = Middle
# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
-letterboxing-disabled-description = Letterboxing is currently disabled.
+letterboxing-disabled-message =
+ .message = Letterboxing is currently disabled.
# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
letterboxing-enable-button =
=====================================
tools/torbrowser/l10n/migrations/bug-44459-letterboxing-settings-group.py
=====================================
@@ -0,0 +1,24 @@
+from fluent.migrate.helpers import transforms_from
+
+
+def migrate(ctx):
+ ctx.add_transforms(
+ "base-browser.ftl",
+ "base-browser.ftl",
+ transforms_from(
+ """
+letterboxing-window-size-group =
+ .label = { COPY_PATTERN(path, "letterboxing-window-size-header") }
+letterboxing-alignment-group =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-header") }
+ .description = { COPY_PATTERN(path, "letterboxing-alignment-description") }
+letterboxing-alignment-top-option =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-top") }
+letterboxing-alignment-middle-option =
+ .label = { COPY_PATTERN(path, "letterboxing-alignment-middle") }
+letterboxing-disabled-message =
+ .message = { COPY_PATTERN(path, "letterboxing-disabled-description") }
+""",
+ path="base-browser.ftl",
+ ),
+ )
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/14497c…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/14497c…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser-build][main] Update rbm for rbm#40103
by boklm (@boklm) 11 Feb '26
by boklm (@boklm) 11 Feb '26
11 Feb '26
boklm pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
809f72b8 by Nicolas Vigier at 2026-02-11T18:30:50+01:00
Update rbm for rbm#40103
- - - - -
1 changed file:
- rbm
Changes:
=====================================
rbm
=====================================
@@ -1 +1 @@
-Subproject commit 4c881eb45291e323dcf4e4f1ae7eabed045ea8a3
+Subproject commit c88489ddb9c3749fe8bdfd0442a19a3bef346727
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/8…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/8…
You're receiving this email because of your account on gitlab.torproject.org.
1
0