tbb-commits
Threads by month
- ----- 2026 -----
- 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
- 1 participants
- 19930 discussions
[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
[Git][tpo/applications/rbm][main] Bug 40103: Allow having multiple tmp_dir values
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 / RBM
Commits:
c88489dd by Nicolas Vigier at 2026-02-11T12:44:50+01:00
Bug 40103: Allow having multiple tmp_dir values
The `rbm_tmp_dir` function (and config option) is used to get a
directory where temporary files can be stored. This directory is
automatically removed when rbm exits, and its location is based on the
`tmp_dir` config option. To return always the same directory and avoid
creating a new one each time, a state variable is used, however that
means that the value of the `tmp_dir` config option is ignored on
following uses of `rbm_tmp_dir`. To fix that we change the state
variable to be a hash variable, using `tmp_dir` as key. So that we
create the temporary directory one time per value of `tmp_dir`.
We are also adding a test to check the temporary directory from which we
build is matching `tmp_dir` when we have two separate projects using a
different value. The test was failing without the change and is now
passing.
- - - - -
5 changed files:
- lib/RBM/DefaultConfig.pm
- test.pl
- + test/projects/tmpdir_t1/config
- + test/projects/tmpdir_t2/config
- + test/projects/tmpdir_t3/config
Changes:
=====================================
lib/RBM/DefaultConfig.pm
=====================================
@@ -88,14 +88,14 @@ sub docker_version {
sub rbm_tmp_dir {
my ($project, $options) = @_;
- CORE::state $rbm_tmp_dir;
- return $rbm_tmp_dir->dirname if $rbm_tmp_dir;
+ CORE::state %rbm_tmp_dir;
my $tmp_dir = RBM::project_config($project, 'tmp_dir', $options)
|| RBM::exit_error('No tmp_dir specified');
+ return $rbm_tmp_dir{$tmp_dir}->dirname if $rbm_tmp_dir{$tmp_dir};
make_path($tmp_dir);
- $rbm_tmp_dir = File::Temp->newdir(TEMPLATE => 'rbm-XXXXXX',
+ $rbm_tmp_dir{$tmp_dir} = File::Temp->newdir(TEMPLATE => 'rbm-XXXXXX',
DIR => $tmp_dir);
- return $rbm_tmp_dir->dirname;
+ return $rbm_tmp_dir{$tmp_dir}->dirname;
}
our %default_config = (
=====================================
test.pl
=====================================
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
use Path::Tiny;
-use Test::More tests => 45;
+use Test::More tests => 46;
use lib 'lib/';
sub set_target {
@@ -282,6 +282,15 @@ my @tests = (
target => [ 'wrong_sha512sum' ],
fail_build => [ 'shasum', 'build' ],
},
+ {
+ name => 'setting different tmp_dir per project',
+ step => 'build',
+ target => [],
+ build => [ 'tmpdir_t1', 'build' ],
+ files => {
+ 'out/tmpdir_t1.txt' => "/var/tmp\n/tmp\n",
+ },
+ },
);
foreach my $test (@tests) {
=====================================
test/projects/tmpdir_t1/config
=====================================
@@ -0,0 +1,11 @@
+filename: tmpdir_t1.txt
+tmp_dir: /tmp
+build: |
+ #!/bin/sh
+ set -e
+ cat tmpdir_t2.txt tmpdir_t3.txt > [% dest_dir %]/[% c('filename') %]
+input_files:
+ - project: tmpdir_t2
+ refresh_input: 1
+ - project: tmpdir_t3
+ refresh_input: 1
=====================================
test/projects/tmpdir_t2/config
=====================================
@@ -0,0 +1,8 @@
+filename: tmpdir_t2.txt
+tmp_dir: /var/tmp
+build: |
+ #!/bin/sh
+ set -e
+ dir=$(dirname $(dirname $(pwd)))
+ test "$dir" = '[% c("tmp_dir") %]'
+ echo "$dir" > [% dest_dir %]/[% c('filename') %]
=====================================
test/projects/tmpdir_t3/config
=====================================
@@ -0,0 +1,8 @@
+filename: tmpdir_t3.txt
+tmp_dir: /tmp
+build: |
+ #!/bin/sh
+ set -e
+ dir=$(dirname $(dirname $(pwd)))
+ test "$dir" = '[% c("tmp_dir") %]'
+ echo "$dir" > [% dest_dir %]/[% c('filename') %]
View it on GitLab: https://gitlab.torproject.org/tpo/applications/rbm/-/commit/c88489ddb9c3749…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/rbm/-/commit/c88489ddb9c3749…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser-build][main] Bug 41713: Triage: find components for bugs found from commits.
by Pier Angelo Vendrame (@pierov) 11 Feb '26
by Pier Angelo Vendrame (@pierov) 11 Feb '26
11 Feb '26
Pier Angelo Vendrame pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
3086604b by Pier Angelo Vendrame at 2026-02-11T15:50:54+00:00
Bug 41713: Triage: find components for bugs found from commits.
In the Bugzilla triage script, run a second query for the bugs that
were not found in the first query and instead have been found with
git commits.
- - - - -
2 changed files:
- − tools/browser/generate-bugzilla-triage-csv
- + tools/browser/generate-bugzilla-triage-csv.py
Changes:
=====================================
tools/browser/generate-bugzilla-triage-csv deleted
=====================================
@@ -1,249 +0,0 @@
-#!/usr/bin/env bash
-
-# gitlab labels for review tickets
-browser_label="Apps::Product::TorBrowser"
-esr_label="esr-next"
-priority_label="Priority::Medium"
-impact_label="Apps::Impact::Unknown"
-type_label="Apps::Type::Audit"
-
-# milestone for the next major Tor Browser release
-milestone="Browser 16.0"
-
-# prints to stderr
-function echoerr() { echo "$@" 1>&2; }
-
-script_dir=$(dirname "${BASH_ARGV0:-$0}")
-
-# help dialog
-if [ "$#" -ne 2 ]; then
- echoerr "Usage: $0 <ff-version> <gitlab-audit-issue>"
- echoerr
- echoerr "ff-version rapid-release Firefox version to audit"
- echoerr "gitlab-audit-issue tor-browser GitLab issue number for this audit"
- echoerr ""
- echoerr "Example:"
- echoerr ""
- echoerr "$0 129 43303"
- exit 1
-fi
-
-# exit on error
-set -e
-
-
-# Ensure various required tools are available
-function check_exists() {
- local cmd=$1
- if ! which ${cmd} > /dev/null ; then
- echoerr "missing ${cmd} dependency"
- exit 1
- fi
-}
-
-check_exists git
-check_exists jq
-check_exists mktemp
-check_exists perl
-check_exists printf
-check_exists sed
-check_exists sort
-check_exists touch
-check_exists uniq
-check_exists wget
-
-# Assign arguments to named variables
-firefox_version=$1
-firefox_old_version=$((firefox_version - 1))
-audit_issue=$2
-git_begin="FIREFOX_NIGHTLY_${firefox_old_version}_END"
-git_end="FIREFOX_NIGHTLY_${firefox_version}_END"
-
-# Check valid Firefox version
-if ! [[ "${firefox_version}" =~ ^[1-9][0-9]{2}$ ]]; then
- echoerr "invalid Firefox version (probably)"
- exit 1
-fi
-
-# Check valid Gitlab issue number
-if ! [[ "${audit_issue}" =~ ^[1-9][0-9]{4}$ ]]; then
- echoerr "invalid gitlab audit issue number (probably)"
- exit 1
-fi
-
-#
-# Encoding/Decoding Functions
-#
-
-# escape " and \
-function json_escape() {
- local input="$1"
- echo "${input}" | sed 's/["\]/\\"/g'
-}
-
-
-# un-escape \"
-function jq_unescape() {
- local input="$1"
- echo "${input}" | sed 's/\\"/"/g'
-}
-
-# change quotes to double-quotes
-function csv_escape() {
- local input="$1"
- echo "${input}" | sed 's/"/""/g'
-}
-
-# we need to urlencode the strings used in the new issue link
-function url_encode() {
- local input="$1"
- echo "${input}" | perl -MURI::Escape -wlne 'print uri_escape $_'
-}
-
-
-#
-# Create temp json files
-#
-git_json=$(mktemp -t git-audit-${firefox_version}-XXXXXXXXXXX.json)
-bugzilla_json=$(mktemp -t bugzilla-audit-${firefox_version}-XXXXXXXXXXX.json)
-union_json=$(mktemp -t union-audit-${firefox_version}-XXXXXXXXXXX.json)
-touch "${git_json}"
-touch "${bugzilla_json}"
-touch "${union_json}"
-
-function json_cleanup {
- rm -f "${git_json}"
- rm -f "${bugzilla_json}"
- rm -f "${union_json}"
- popd > /dev/null
-}
-pushd "${script_dir}/torbrowser" > /dev/null
-trap json_cleanup EXIT
-
-#
-# Generate Git Commit Triage List
-#
-
-# Try and extract bug id and summary from git log
-# Mozilla's commits are not always 100% consistently named, so this
-# regex is a bit flexible to handle various inputs such as:
-# "Bug 1234 -", "Bug 1234:", "Bug Bug 1234 -", "[Bug 1234] -", " bug 1234 -".
-sed_extract_id_summary="s/^[[ ]*[bug –-]+ ([1-9][0-9]*)[]:\., –-]*(.*)\$/\\1 \\2/pI"
-
-# Generate a json array of objects in the same format as bugzilla: {component: string, id: number, summary: string}
-printf "[\n" >> "${git_json}"
-
-first_object=true
-git log --format='%s' $git_begin..$git_end \
-| sed -En "${sed_extract_id_summary}" \
-| sort -h \
-| uniq \
-| while IFS= read -r line; do
- read -r id summary <<< "${line}"
- summary=$(json_escape "${summary}")
-
- # json does not allow trailing commas
- if [[ "${first_object}" = true ]]; then
- first_object=false
- else
- printf ",\n" >> "${git_json}"
- fi
-
- product="Unknown"
- # Bugs that include webcompat-reviewers and no other additional -reviewers
- # from other teams are *likely* in the Web Compatibility component. But they
- # won't show in the bugzilla query because the component doesn't tend to
- # have any set milestones.
- if [[ "${summary}" =~ r=.*webcompat-reviewers && ! "${summary}" =~ r=.*-reviewers.*-reviewers ]]; then
- product="Web Compatibility"
- fi
-
- printf " { \"product\": \"%s\", \"component\": \"Unknown\", \"id\": %s, \"summary\": \"%s\" }" "${product}" ${id} "${summary}" >> "${git_json}"
-done
-printf "\n]\n" >> "${git_json}"
-
-#
-# Download Bugzilla Triage List
-#
-
-# search for:
-# + Product is NOT "Thunderbird,Calander,Chat Core,MailNews Core" (&f1=product&n1=1&o1=anyexact&v1=Thunderbird%2CCalendar%2CChat%20Core%2CMailNews%20Core). AND
-# + Target Milestone contains "${firefox_version}" (e.g. 115 Branch or Firefox 115) (&f2=target_milestone&o2=substring&v2=${firefox_version}).
-# "&limit=0" shows all matching bugs.
-
-query_tail="&f1=product&n1=1&o1=anyexact&v1=Thunderbird%2CCalendar%2CChat%20Core%2CMailNews%20Core&f2=target_milestone&o2=substring&v2=${firefox_version}&limit=0"
-
-bugzilla_query="https://bugzilla.mozilla.org/buglist.cgi?${query_tail}"
-bugzilla_json_query="https://bugzilla.mozilla.org/rest/bug?include_fields=id,product,component,s…"
-
-wget "${bugzilla_json_query}" -O ${bugzilla_json}
-
-#
-# Create Union of these two sets of issues
-#
-
-# bugzilla array is actually on a root object: { bugs: [...] }
-jq -s '[ (.[0].bugs)[], (.[1])[] ] | group_by(.id) | map(.[0])' "${bugzilla_json}" "${git_json}" > "${union_json}"
-
-#
-# Generate Triage CSV
-#
-
-echo "\"Review\",,\"Product :: Component\",\"Bugzilla Bug\""
-
-jq '. | sort_by([.product, .component, .id])[] | "\(.id)|\(.product)|\(.component)|\(.summary)"' ${union_json} \
-| while IFS='|' read -r id product component summary; do
-
- # bugzilla info
- id="${id:1}"
- component="${component:0}"
- summary="${summary:0:-1}"
- summary=$(jq_unescape "${summary}")
- # short summary for gitlab issue title
- [[ ${#summary} -gt 80 ]] && summary_short="${summary:0:77}..." || summary_short="${summary}"
-
- # filter out some issue types that we never care about
- skip_issue=false
-
- # skip `[wpt-sync] Sync PR`
- if [[ "${summary}" =~ ^\[wpt-sync\]\ Sync\ PR.*$ ]]; then
- skip_issue=true
- # skip `Crash in [@` and variants
- elif [[ "${summary}" =~ ^Crash[esin\ ]*\ \[\@.*$ ]]; then
- skip_issue=true
- # skip `Assertion failuire: `
- elif [[ "${summary}" =~ ^Assertion\ failure:\ .*$ ]]; then
- skip_issue=true
- # skip `Hit MOZ_CRASH`
- elif [[ "${summary}" =~ ^Hit\ MOZ_CRASH.*$ ]]; then
- skip_issue=true
- fi
-
- if [[ "${skip_issue}" = true ]]; then
- echoerr "Skipped Bugzilla ${id}: ${summary_short}"
- else
- csv_summary=$(csv_escape "${summary}")
- csv_product_component=$(csv_escape "${product} :: ${component}")
-
- # parent issue
- bugzilla_url="https://bugzilla.mozilla.org/show_bug.cgi?id=${id}"
- # review issue title
- new_issue_title=$(url_encode "Review Mozilla ${id}: ${summary_short}")
- # review issue description + labeling (14.0 stable, FF128-esr, Next)
- new_issue_description=$(url_encode "### Bugzilla: ${bugzilla_url}")%0A$(url_encode "/label ~\"${browser_label}\" ~\"${esr_label}\" ~\"${priority_label}\" ~\"${impact_label}\" ~\"${type_label}\"")%0A$(url_encode "/milestone %\"${milestone}\"")%0A$(url_encode "/relate tpo/applications/tor-browser#${audit_issue}")%0A%0A$(url_encode "<!-- briefly describe why this issue needs further review -->")%0A
-
- # url which create's new issue with title and description pre-populated
- new_issue_url="https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/new?iss…"
-
- # this link will start the creation of a new gitlab issue to review
- create_issue=$(csv_escape "=HYPERLINK(\"${new_issue_url}\", \"New Issue\")")
- bugzilla_link=$(csv_escape "=HYPERLINK(\"${bugzilla_url}\", \"Bugzilla ${id}: ${csv_summary}\")")
-
- echo "FALSE,\"${create_issue}\",\"${csv_product_component}\",\"${bugzilla_link}\","
- fi
-done
-
-echo
-
-bugzilla_query="=HYPERLINK(\"${bugzilla_query}\", \"Bugzilla query\")"
-echo \"$(csv_escape "${bugzilla_query}")\"
=====================================
tools/browser/generate-bugzilla-triage-csv.py
=====================================
@@ -0,0 +1,207 @@
+#!/usr/bin/env python3
+import argparse
+import csv
+import re
+import sys
+import urllib.parse
+from pathlib import Path
+
+import requests
+from git import Repo
+
+
+GITLAB_LABELS = [
+ "Apps::Product::TorBrowser",
+ "esr-next",
+ "Priority::Medium",
+ "Apps::Impact::Unknown",
+ "Apps::Type::Audit",
+]
+GITLAB_MILESTONE = "Browser 16.0"
+
+
+def download_bugs(url):
+ url += "&" if "?" in url else "?"
+ url += "include_fields=id,product,component,summary"
+ r = requests.get(url)
+ r.raise_for_status()
+ # {"bugs": [ {...}, ... ]}
+ bugs = r.json().get("bugs", [])
+ results = {}
+ for bug in bugs:
+ product = bug.get("product", "")
+ component = bug.get("component", "")
+ results[bug.get("id")] = {
+ "id": bug.get("id"),
+ "component": f"{product} :: {component}",
+ "summary": bug.get("summary", ""),
+ }
+ return results
+
+
+def extract_from_git(repo_path, ff_version, bugs):
+ subj_regex = re.compile(
+ r"^[\s*[bug –-]+\s*([1-9][0-9]*)[\]:\., –-]*(.*)", re.VERBOSE
+ )
+ # Keep these lowercase
+ skip = ["no bug", "merge ", "revert "]
+
+ repo = Repo(repo_path)
+ seen_ids = set()
+ results = {}
+ for commit in repo.iter_commits(
+ f"FIREFOX_NIGHTLY_{ff_version - 1}_END..FIREFOX_NIGHTLY_{ff_version}_END",
+ reverse=True,
+ ):
+ subject = commit.message.splitlines()[0]
+ subj_low = subject.lower()
+ m = subj_regex.search(subj_low)
+ if not m:
+ if not any(subj_low.startswith(p) for p in skip):
+ print(f"Could not match {subject}", file=sys.stderr)
+ continue
+ bug_id = int(m.group(1))
+ if bug_id in bugs or bug_id in seen_ids:
+ continue
+ seen_ids.add(bug_id)
+ summary = m.group(2).strip()
+ results[bug_id] = {
+ "id": bug_id,
+ "component": "(git commit)",
+ "summary": summary,
+ }
+
+ # Notice that seen_ids contains only the bugs we have seen in the
+ # commit range but we did not find earlier.
+ # So, we expect this number to be quite low and that it will be
+ # possible to fetch all these bugs in a single pass.
+ if seen_ids:
+ url = "https://bugzilla.mozilla.org/rest/bug?id="
+ url += ",".join([str(i) for i in seen_ids])
+ results.update(download_bugs(url))
+ bugs.update(results)
+
+
+def make_hyperlink(url, label):
+ label = label.replace('"', '""')
+ return f'=HYPERLINK("{url}", "{label}")'
+
+
+def url_encode(s):
+ return urllib.parse.quote(s)
+
+
+def generate_csv(bugs, audit_issue, query, output_path):
+ bugs = sorted(bugs.values(), key=lambda x: (x["component"], x["id"]))
+
+ with output_path.open("w") as f:
+ writer = csv.writer(f, quoting=csv.QUOTE_ALL)
+ writer.writerow(["Review", "", "Bugzilla Component", "Bugzilla Bug"])
+
+ # Keep these lowercase!
+ skip = [
+ "[wpt-sync] sync pr",
+ "assertion failure: ",
+ "crash in ",
+ "crash [@",
+ "hit moz_crash",
+ "update android nightly application-services",
+ "update web-platform-tests",
+ ]
+ for bug in bugs:
+ bug_id = bug["id"]
+ component = bug["component"]
+ summary = bug["summary"]
+ summary_lower = summary.lower()
+ short = (summary[:77] + "...") if len(summary) > 80 else summary
+
+ if any(summary_lower.startswith(p) for p in skip):
+ print(f"Skipped Bugzilla {bug_id}: {summary}", file=sys.stderr)
+ continue
+
+ bugzilla_url = (
+ f"https://bugzilla.mozilla.org/show_bug.cgi?id={bug_id}"
+ )
+ new_title = url_encode(f"Review Mozilla {bug_id}: {short}")
+ new_desc = (
+ url_encode(f"### Bugzilla: {bugzilla_url}")
+ + "%0A"
+ + url_encode("/label ~" + (" ~".join(GITLAB_LABELS)))
+ + "%0A"
+ + url_encode(f'/milestone %"{GITLAB_MILESTONE}"')
+ + "%0A"
+ + url_encode(
+ f"/relate tpo/applications/tor-browser#{audit_issue}"
+ )
+ + "%0A%0A"
+ + url_encode(
+ "<!-- briefly describe why this issue needs further review -->"
+ )
+ )
+ new_issue_url = f"https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/new?iss…"
+
+ create_link = make_hyperlink(new_issue_url, "New Issue")
+ bugzilla_link = make_hyperlink(
+ bugzilla_url, f"Bugzilla {bug_id}: {summary}"
+ )
+ writer.writerow(["FALSE", create_link, component, bugzilla_link])
+
+ writer.writerow([])
+ writer.writerow([make_hyperlink(query, "Bugzilla query")])
+
+
+def main():
+ parser = argparse.ArgumentParser(
+ description="Create a triage CSV for a Firefox version."
+ )
+ parser.add_argument(
+ "-r",
+ "--repo-path",
+ help="Path to a tor-browser.git clone",
+ type=Path,
+ default=Path(__file__).parent / "torbrowser",
+ )
+ parser.add_argument(
+ "-o",
+ "--output-file",
+ help="Path to the output file",
+ type=Path,
+ )
+ parser.add_argument(
+ "ff_version",
+ help="Firefox rapid-release version (e.g. 150)",
+ type=int,
+ )
+ parser.add_argument(
+ "gitlab_audit_issue",
+ help="Tor-Browser-Spec GitLab issue number",
+ type=int,
+ )
+ known_args, remaining = parser.parse_known_args()
+ parser.set_defaults(
+ output_file=Path(f"triage-{known_args.ff_version}.csv")
+ )
+ args = parser.parse_args()
+
+ if args.ff_version < 140:
+ print("Wrong Firefox version (probably)!", file=sys.stderr)
+ sys.exit(1)
+ if args.gitlab_audit_issue < 40000:
+ print("Wrong GitLab issue number (probably)!", file=sys.stderr)
+ sys.exit(1)
+
+ excluded_products = "Thunderbird,Calendar,Chat%20Core,MailNews%20Core"
+ query = f"https://bugzilla.mozilla.org/rest/bug?f1=product&n1=1&o1=anyexact&v1={exclu…"
+ bugs = download_bugs(query)
+ extract_from_git(args.repo_path, args.ff_version, bugs)
+
+ generate_csv(
+ bugs,
+ args.gitlab_audit_issue,
+ query,
+ args.output_file,
+ )
+
+
+if __name__ == "__main__":
+ main()
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/3…
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] fixup! TB 40933: Add tor-launcher functionality
by Pier Angelo Vendrame (@pierov) 11 Feb '26
by Pier Angelo Vendrame (@pierov) 11 Feb '26
11 Feb '26
Pier Angelo Vendrame pushed to branch tor-browser-147.0a1-16.0-2 at The Tor Project / Applications / Tor Browser
Commits:
14497cc9 by Pier Angelo Vendrame at 2026-02-11T15:30:20+01:00
fixup! TB 40933: Add tor-launcher functionality
TB 44619: Add more tor logs to the UI.
Usually, we show in the UI only the logs we received from the tor
daemon.
However, for troubleshooting, it makes sense to display more errors,
e.g., about failure to start a tor process, or to connect to the
control port.
We already had those in the browser console, however it is not trivial
to get them, especially on Android.
TB 43403&43560: Add "UTC" to the log timestamp.
- - - - -
4 changed files:
- toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
- toolkit/components/tor-launcher/TorProcess.sys.mjs
- toolkit/components/tor-launcher/TorProcessAndroid.sys.mjs
- toolkit/components/tor-launcher/TorProvider.sys.mjs
Changes:
=====================================
toolkit/components/tor-launcher/TorLauncherUtil.sys.mjs
=====================================
@@ -11,6 +11,7 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
FileUtils: "resource://gre/modules/FileUtils.sys.mjs",
+ TorProviderTopics: "resource://gre/modules/TorProviderBuilder.sys.mjs",
});
const kPropBundleURI = "chrome://torbutton/locale/torlauncher.properties";
@@ -699,4 +700,27 @@ export const TorLauncherUtil = {
console.warn("Could not remove the IPC directory", e);
}
},
+
+ /**
+ * Broadcast a tor log message. This message will be visible to the user.
+ *
+ * NOTE: Users are likely to copy and paste their tor log to forums, etc.
+ * Therefore, the messages should avoid containing any information that might
+ * identify information about the user.
+ *
+ * @param {string} type The log type (ERR, WARN, etc...)
+ * @param {string} msg The log message
+ */
+ log(type, msg) {
+ const timestamp =
+ new Date().toISOString().replace("T", " ").replace("Z", "") + " UTC";
+ Services.obs.notifyObservers(
+ { type, msg, timestamp },
+ lazy.TorProviderTopics.TorLog
+ );
+ if (type === "WARN" || type === "ERR") {
+ // Notify so that Copy Log can be enabled.
+ Services.obs.notifyObservers(null, lazy.TorProviderTopics.HasWarnOrErr);
+ }
+ },
};
=====================================
toolkit/components/tor-launcher/TorProcess.sys.mjs
=====================================
@@ -141,9 +141,18 @@ export class TorProcess {
this.#status = TorProcessStatus.Exited;
this.#subprocess = null;
logger.error("startTor error:", e);
+ lazy.TorLauncherUtil.log(
+ "PARENT-ERR",
+ "Failed to start a tor process (more information in the browser console)."
+ );
throw e;
}
+ lazy.TorLauncherUtil.log(
+ "PARENT-INFO",
+ `New tor process started with pid ${this.#subprocess.pid}.`
+ );
+
// Do not await the following functions, as they will return only when the
// process exits.
this.#dumpStdout();
@@ -189,8 +198,15 @@ export class TorProcess {
const { exitCode } = await watched.wait();
processExitCode = exitCode;
+ lazy.TorLauncherUtil.log(
+ exitCode !== 0 ? "PARENT-WARN" : "PARENT-INFO",
+ `The tor process with pid ${this.#subprocess.pid} exited with code ${exitCode}.`
+ );
+
if (watched !== this.#subprocess) {
- logger.debug(`A Tor process exited with code ${exitCode}.`);
+ logger.debug(
+ `The tor process ${watched.pid} exited with code ${exitCode}.`
+ );
} else if (exitCode) {
logger.warn(`The watched Tor process exited with code ${exitCode}.`);
} else {
=====================================
toolkit/components/tor-launcher/TorProcessAndroid.sys.mjs
=====================================
@@ -6,6 +6,7 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
EventDispatcher: "resource://gre/modules/Messaging.sys.mjs",
+ TorLauncherUtil: "resource://gre/modules/TorLauncherUtil.sys.mjs",
});
const logger = console.createInstance({
@@ -107,6 +108,27 @@ export class TorProcessAndroid {
}
onEvent(event, data, _callback) {
+ switch (event) {
+ case TorIncomingEvents.started:
+ lazy.TorLauncherUtil.log(
+ "PARENT-INFO",
+ `New tor process with handle ${data.handle} started.`
+ );
+ break;
+ case TorIncomingEvents.startFailed:
+ lazy.TorLauncherUtil.log(
+ "PARENT-ERR",
+ `Failed to start a tor process: ${data.error}`
+ );
+ break;
+ case TorIncomingEvents.exited:
+ lazy.TorLauncherUtil.log(
+ data.status !== 0 ? "PARENT-WARN" : "PARENT-INFO",
+ `The tor process with handle ${data.handle} exited with status ${data.status}.`
+ );
+ break;
+ }
+
if (data?.handle !== this.#processHandle) {
logger.debug(`Ignoring event ${event} with another handle`, data);
return;
=====================================
toolkit/components/tor-launcher/TorProvider.sys.mjs
=====================================
@@ -207,8 +207,15 @@ export class TorProvider {
await this.#firstConnection();
} catch (e) {
logger.error("Cannot connect to the control port", e);
+ // Log this also to the UI, as getting console logs from Android
+ // makes troubleshooting more difficult and involved.
+ TorLauncherUtil.log(
+ "PARENT-ERR",
+ `Connection to the control port failed: ${e.message}.`
+ );
throw e;
}
+ TorLauncherUtil.log("PARENT-INFO", "Connected to the control port.", false);
if (this.ownsTorDaemon) {
try {
@@ -1021,21 +1028,7 @@ export class TorProvider {
* @param {string} msg The message
*/
onLogMessage(type, msg) {
- if (type === "WARN" || type === "ERR") {
- // Notify so that Copy Log can be enabled.
- Services.obs.notifyObservers(null, TorProviderTopics.HasWarnOrErr);
- }
-
- const timestamp = new Date()
- .toISOString()
- .replace("T", " ")
- .replace("Z", "");
-
- Services.obs.notifyObservers(
- { type, msg, timestamp },
- TorProviderTopics.TorLog
- );
-
+ TorLauncherUtil.log(type, msg);
switch (type) {
case "ERR":
logger.error(`[Tor error] ${msg}`);
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/14497cc…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/14497cc…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser-build][maint-15.0] Add missing paragraph separator in MB Alpha relprep gitlab issue template.
by ma1 (@ma1) 11 Feb '26
by ma1 (@ma1) 11 Feb '26
11 Feb '26
ma1 pushed to branch maint-15.0 at The Tor Project / Applications / tor-browser-build
Commits:
523cb251 by hackademix at 2026-02-11T07:36:27+01:00
Add missing paragraph separator in MB Alpha relprep gitlab issue template.
- - - - -
1 changed file:
- .gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md
Changes:
=====================================
.gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md
=====================================
@@ -183,6 +183,7 @@ This step will send the relevant branches, tags (including a tag named after the
<details>
<summary>Communications</summary>
### packagers
+
- [ ] **(Optional, Once Packages are pushed to GitHub)**
- **NOTE**: This is an optional step and only necessary close a major release/transition from alpha to stable, or if there are major packing changes these developers need to be aware of
- **Recipients**
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/5…
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/5…
You're receiving this email because of your account on gitlab.torproject.org.
1
0
[Git][tpo/applications/tor-browser-build][main] Add missing paragraph separator in MB Alpha relprep gitlab issue template.
by ma1 (@ma1) 11 Feb '26
by ma1 (@ma1) 11 Feb '26
11 Feb '26
ma1 pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits:
a7cfc529 by hackademix at 2026-02-11T07:35:19+01:00
Add missing paragraph separator in MB Alpha relprep gitlab issue template.
- - - - -
1 changed file:
- .gitlab/issue_templates/050 Release Prep - Mullvad Browser Alpha.md
Changes:
=====================================
.gitlab/issue_templates/050 Release Prep - Mullvad Browser Alpha.md
=====================================
@@ -183,6 +183,7 @@ This step will send the relevant branches, tags (including a tag named after the
<details>
<summary>Communications</summary>
### packagers
+
- [ ] **(Optional, Once Packages are pushed to GitHub)**
- **NOTE**: This is an optional step and only necessary close a major release/transition from alpha to stable, or if there are major packing changes these developers need to be aware of
- **Recipients**
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