ma1 pushed to branch tor-browser-115.9.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits:
- 
106d93c8
by hackademix at 2024-03-21T14:52:16+01:00
- 
f7adb137
by hackademix at 2024-03-21T14:52:17+01:00
12 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-top-dark.svg
- + browser/components/preferences/letterboxing-top-light.svg
- + browser/components/preferences/letterboxing.css
- + browser/components/preferences/letterboxing.inc.xhtml
- + browser/components/preferences/letterboxing.js
- browser/components/preferences/main.inc.xhtml
- browser/components/preferences/main.js
- browser/components/preferences/preferences.xhtml
- browser/locales/en-US/browser/base-browser.ftl
Changes:
| ... | ... | @@ -22,3 +22,10 @@ browser.jar: | 
| 22 | 22 |     content/browser/preferences/more-from-mozilla-qr-code-simple-cn.svg
 | 
| 23 | 23 |     content/browser/preferences/web-appearance-dark.svg
 | 
| 24 | 24 |     content/browser/preferences/web-appearance-light.svg
 | 
| 25 | + | |
| 26 | +   content/browser/preferences/letterboxing.js
 | |
| 27 | +   content/browser/preferences/letterboxing.css
 | |
| 28 | +   content/browser/preferences/letterboxing-middle-dark.svg
 | |
| 29 | +   content/browser/preferences/letterboxing-middle-light.svg
 | |
| 30 | +   content/browser/preferences/letterboxing-top-dark.svg
 | |
| 31 | +   content/browser/preferences/letterboxing-top-light.svg | 
| 1 | +<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
 | |
| 2 | +<g filter="url(#filter0_d_2272_529)">
 | |
| 3 | +<g clip-path="url(#clip0_2272_529)">
 | |
| 4 | +<path d="M58 3H4V45H58V3Z" fill="#42414D"/>
 | |
| 5 | +<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
 | |
| 6 | +<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
 | |
| 7 | +<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"/>
 | |
| 8 | +<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"/>
 | |
| 9 | +<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"/>
 | |
| 10 | +<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"/>
 | |
| 11 | +<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"/>
 | |
| 12 | +<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
 | |
| 13 | +<rect x="8" y="18" width="46" height="23" rx="2" fill="#3A3944"/>
 | |
| 14 | +<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"/>
 | |
| 15 | +<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"/>
 | |
| 16 | +<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"/>
 | |
| 17 | +</g>
 | |
| 18 | +<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
 | |
| 19 | +</g>
 | |
| 20 | +<defs>
 | |
| 21 | +<filter id="filter0_d_2272_529" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
 | |
| 22 | +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
 | |
| 23 | +<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"/>
 | |
| 24 | +<feOffset dy="1"/>
 | |
| 25 | +<feGaussianBlur stdDeviation="2"/>
 | |
| 26 | +<feComposite in2="hardAlpha" operator="out"/>
 | |
| 27 | +<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"/>
 | |
| 28 | +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_529"/>
 | |
| 29 | +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_529" result="shape"/>
 | |
| 30 | +</filter>
 | |
| 31 | +<clipPath id="clip0_2272_529">
 | |
| 32 | +<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
 | |
| 33 | +</clipPath>
 | |
| 34 | +</defs>
 | |
| 35 | +</svg> | 
| 1 | +<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
 | |
| 2 | +<g filter="url(#filter0_d_202_960)">
 | |
| 3 | +<g clip-path="url(#clip0_202_960)">
 | |
| 4 | +<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
 | |
| 5 | +<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
 | |
| 6 | +<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
 | |
| 7 | +<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"/>
 | |
| 8 | +<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"/>
 | |
| 9 | +<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"/>
 | |
| 10 | +<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"/>
 | |
| 11 | +<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"/>
 | |
| 12 | +<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
 | |
| 13 | +<rect x="8" y="18" width="46" height="23" rx="2" fill="white"/>
 | |
| 14 | +<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"/>
 | |
| 15 | +<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"/>
 | |
| 16 | +<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"/>
 | |
| 17 | +</g>
 | |
| 18 | +<rect x="4.5" y="3.5" width="53" height="41" rx="1.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
 | |
| 19 | +</g>
 | |
| 20 | +<defs>
 | |
| 21 | +<filter id="filter0_d_202_960" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
 | |
| 22 | +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
 | |
| 23 | +<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"/>
 | |
| 24 | +<feOffset dy="1"/>
 | |
| 25 | +<feGaussianBlur stdDeviation="2"/>
 | |
| 26 | +<feComposite in2="hardAlpha" operator="out"/>
 | |
| 27 | +<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"/>
 | |
| 28 | +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_960"/>
 | |
| 29 | +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_960" result="shape"/>
 | |
| 30 | +</filter>
 | |
| 31 | +<clipPath id="clip0_202_960">
 | |
| 32 | +<rect x="4" y="3" width="54" height="42" rx="2" fill="white"/>
 | |
| 33 | +</clipPath>
 | |
| 34 | +</defs>
 | |
| 35 | +</svg> | 
| 1 | +<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
 | |
| 2 | +<g filter="url(#filter0_d_2272_508)">
 | |
| 3 | +<g clip-path="url(#clip0_2272_508)">
 | |
| 4 | +<path d="M58 3H4V45H58V3Z" fill="#52525E"/>
 | |
| 5 | +<path d="M58 3H4V14H58V3Z" fill="#42414D"/>
 | |
| 6 | +<path d="M58 3H4V8H58V3Z" fill="#2B2A33"/>
 | |
| 7 | +<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"/>
 | |
| 8 | +<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"/>
 | |
| 9 | +<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"/>
 | |
| 10 | +<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"/>
 | |
| 11 | +<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"/>
 | |
| 12 | +<path d="M58 14H4V45H58V14Z" fill="#5B5B66"/>
 | |
| 13 | +<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="#3A3944"/>
 | |
| 14 | +<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"/>
 | |
| 15 | +<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"/>
 | |
| 16 | +<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"/>
 | |
| 17 | +</g>
 | |
| 18 | +<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
 | |
| 19 | +</g>
 | |
| 20 | +<defs>
 | |
| 21 | +<filter id="filter0_d_2272_508" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
 | |
| 22 | +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
 | |
| 23 | +<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"/>
 | |
| 24 | +<feOffset dy="1"/>
 | |
| 25 | +<feGaussianBlur stdDeviation="2"/>
 | |
| 26 | +<feComposite in2="hardAlpha" operator="out"/>
 | |
| 27 | +<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"/>
 | |
| 28 | +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2272_508"/>
 | |
| 29 | +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2272_508" result="shape"/>
 | |
| 30 | +</filter>
 | |
| 31 | +<clipPath id="clip0_2272_508">
 | |
| 32 | +<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
 | |
| 33 | +</clipPath>
 | |
| 34 | +</defs>
 | |
| 35 | +</svg> | 
| 1 | +<svg width="62" height="50" viewBox="0 0 62 50" fill="none" xmlns="http://www.w3.org/2000/svg">
 | |
| 2 | +<g filter="url(#filter0_d_202_926)">
 | |
| 3 | +<g clip-path="url(#clip0_202_926)">
 | |
| 4 | +<path d="M58 3H4V45H58V3Z" fill="#F0F0F4"/>
 | |
| 5 | +<path d="M58 3H4V14H58V3Z" fill="#F0F0F4"/>
 | |
| 6 | +<path d="M58 3H4V8H58V3Z" fill="#E0E0E6"/>
 | |
| 7 | +<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"/>
 | |
| 8 | +<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"/>
 | |
| 9 | +<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"/>
 | |
| 10 | +<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"/>
 | |
| 11 | +<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"/>
 | |
| 12 | +<path d="M58 14H4V45H58V14Z" fill="#CFCFD8"/>
 | |
| 13 | +<path d="M8 14H55V39C55 40.1046 54.1046 41 53 41H10C8.89543 41 8 40.1046 8 39V14Z" fill="white"/>
 | |
| 14 | +<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"/>
 | |
| 15 | +<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"/>
 | |
| 16 | +<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"/>
 | |
| 17 | +</g>
 | |
| 18 | +<rect x="4.5" y="3.5" width="53" height="41" rx="3.5" stroke="#8F8F9D" shape-rendering="crispEdges"/>
 | |
| 19 | +</g>
 | |
| 20 | +<defs>
 | |
| 21 | +<filter id="filter0_d_202_926" x="0" y="0" width="62" height="50" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
 | |
| 22 | +<feFlood flood-opacity="0" result="BackgroundImageFix"/>
 | |
| 23 | +<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"/>
 | |
| 24 | +<feOffset dy="1"/>
 | |
| 25 | +<feGaussianBlur stdDeviation="2"/>
 | |
| 26 | +<feComposite in2="hardAlpha" operator="out"/>
 | |
| 27 | +<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"/>
 | |
| 28 | +<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_202_926"/>
 | |
| 29 | +<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_202_926" result="shape"/>
 | |
| 30 | +</filter>
 | |
| 31 | +<clipPath id="clip0_202_926">
 | |
| 32 | +<rect x="4" y="3" width="54" height="42" rx="4" fill="white"/>
 | |
| 33 | +</clipPath>
 | |
| 34 | +</defs>
 | |
| 35 | +</svg> | 
| 1 | +.letterboxing-overview {
 | |
| 2 | +  margin-block-end: 32px;
 | |
| 3 | +}
 | |
| 4 | + | |
| 5 | +.letterboxing-search-overview {
 | |
| 6 | +  margin-block-end: 16px;
 | |
| 7 | +}
 | |
| 8 | +#letterboxingAligner {
 | |
| 9 | +  display: flex;
 | |
| 10 | +  justify-content: start;
 | |
| 11 | +  gap: 16px;
 | |
| 12 | +  margin-block: 12px;
 | |
| 13 | + | |
| 14 | +  --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-light.svg");
 | |
| 15 | +  --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-light.svg");
 | |
| 16 | +}
 | |
| 17 | + | |
| 18 | +@media (prefers-color-scheme: dark) {
 | |
| 19 | +  #letterboxingAligner  {
 | |
| 20 | +    --letterboxing-alignment-img-top: url("chrome://browser/content/preferences/letterboxing-top-dark.svg");
 | |
| 21 | +    --letterboxing-alignment-img-middle: url("chrome://browser/content/preferences/letterboxing-middle-dark.svg");
 | |
| 22 | +  }
 | |
| 23 | +}
 | |
| 24 | + | |
| 25 | +#letterboxingAligner .letterboxing-align-top img {
 | |
| 26 | +  content: var(--letterboxing-alignment-img-top);
 | |
| 27 | +}
 | |
| 28 | +#letterboxingAligner .letterboxing-align-middle img {
 | |
| 29 | +  content: var(--letterboxing-alignment-img-middle);
 | |
| 30 | +}
 | |
| 31 | + | |
| 32 | +#letterboxingAligner label {
 | |
| 33 | +  width: 200px;
 | |
| 34 | +  flex: 0 0 auto;
 | |
| 35 | +}
 | |
| 36 | + | |
| 37 | +#letterboxingAligner img {
 | |
| 38 | +  border: none;
 | |
| 39 | +  box-shadow: none;
 | |
| 40 | +}
 | |
| 41 | + | |
| 42 | +/* Hide letterboxing options depending on whether ResistFingerprinting or
 | |
| 43 | + * Letterboxing is enabled. */
 | |
| 44 | +#letterboxingCategory:not(.rfp-enabled),
 | |
| 45 | +#letterboxingCategory:not(.rfp-enabled) ~ #letterboxingDisabled,
 | |
| 46 | +#letterboxingCategory.letterboxing-enabled ~ #letterboxingDisabled,
 | |
| 47 | +#letterboxingCategory:not(.rfp-enabled.letterboxing-enabled) ~ .letterboxing-category {
 | |
| 48 | +  display: none;
 | |
| 49 | +}
 | |
| 50 | + | |
| 51 | +/* We duplicate the Letterboxing overview to appear in search results.
 | |
| 52 | + * We want to hide them whenever they are *not* part of a search result. */
 | |
| 53 | +:is(
 | |
| 54 | +  /* Hide the duplicates when the category is *not* hidden. */
 | |
| 55 | +  #letterboxingCategory:not(.visually-hidden) ~ .letterboxing-category,
 | |
| 56 | +  /* Also hide the duplicated overview for subsequence search results if a
 | |
| 57 | +   * previous groupbox is *not* hidden. */
 | |
| 58 | +  .letterboxing-category:not(.visually-hidden) ~ .letterboxing-category,
 | |
| 59 | +) .letterboxing-search-overview {
 | |
| 60 | +  display: none;
 | |
| 61 | +}
 | |
| 62 | + | |
| 63 | +/* Similarly for #letterboxingDisabled, but we also want to hide its
 | |
| 64 | + * "Letterboxing" heading.
 | |
| 65 | + * NOTE: This should only appear in isolation, so we do not need to worry about
 | |
| 66 | + * subsequent groupboxes. */
 | |
| 67 | +#letterboxingCategory:not(.visually-hidden) ~ #letterboxingDisabled :is(
 | |
| 68 | +  .letterboxing-search-heading,
 | |
| 69 | +  .letterboxing-search-overview
 | |
| 70 | +) {
 | |
| 71 | +  display: none;
 | |
| 72 | +} | 
| 1 | +<script src="chrome://browser/content/preferences/letterboxing.js" />
 | |
| 2 | +<vbox
 | |
| 3 | +  id="letterboxingCategory"
 | |
| 4 | +  class="subcategory"
 | |
| 5 | +  hidden="true"
 | |
| 6 | +  data-category="paneGeneral"
 | |
| 7 | +>
 | |
| 8 | +  <html:h1 data-l10n-id="letterboxing-header" />
 | |
| 9 | +  <description class="letterboxing-overview">
 | |
| 10 | +    <html:span
 | |
| 11 | +      data-l10n-id="letterboxing-overview"
 | |
| 12 | +      class="tail-with-learn-more"
 | |
| 13 | +    ></html:span>
 | |
| 14 | +    <label
 | |
| 15 | +      data-l10n-id="letterboxing-learn-more"
 | |
| 16 | +      class="learnMore text-link"
 | |
| 17 | +      is="text-link"
 | |
| 18 | +      href="about:manual#letterboxing"
 | |
| 19 | +      useoriginprincipal="true"
 | |
| 20 | +    />
 | |
| 21 | +  </description>
 | |
| 22 | +</vbox>
 | |
| 23 | +<groupbox
 | |
| 24 | +  class="letterboxing-category"
 | |
| 25 | +  data-category="paneGeneral"
 | |
| 26 | +  hidden="true"
 | |
| 27 | +>
 | |
| 28 | +  <label><html:h2
 | |
| 29 | +    data-l10n-id="letterboxing-window-size-header"/></label>
 | |
| 30 | +  <description class="letterboxing-search-overview">
 | |
| 31 | +    <html:span
 | |
| 32 | +      data-l10n-id="letterboxing-overview"
 | |
| 33 | +      class="tail-with-learn-more"
 | |
| 34 | +    ></html:span>
 | |
| 35 | +    <label
 | |
| 36 | +      data-l10n-id="letterboxing-learn-more"
 | |
| 37 | +      class="learnMore text-link"
 | |
| 38 | +      is="text-link"
 | |
| 39 | +      href="about:manual#letterboxing"
 | |
| 40 | +      useoriginprincipal="true"
 | |
| 41 | +    />
 | |
| 42 | +  </description>
 | |
| 43 | +  <checkbox
 | |
| 44 | +    id="letterboxingRememberSize"
 | |
| 45 | +    data-l10n-id="letterboxing-remember-size"
 | |
| 46 | +    preference="privacy.resistFingerprinting.letterboxing.rememberSize"
 | |
| 47 | +  />
 | |
| 48 | +</groupbox>
 | |
| 49 | +<groupbox
 | |
| 50 | +  class="letterboxing-category"
 | |
| 51 | +  data-category="paneGeneral"
 | |
| 52 | +  hidden="true"
 | |
| 53 | +>
 | |
| 54 | +  <label><html:h2
 | |
| 55 | +    data-l10n-id="letterboxing-alignment-header"
 | |
| 56 | +    /></label>
 | |
| 57 | +  <description class="letterboxing-search-overview">
 | |
| 58 | +    <html:span
 | |
| 59 | +      data-l10n-id="letterboxing-overview"
 | |
| 60 | +      class="tail-with-learn-more"
 | |
| 61 | +    ></html:span>
 | |
| 62 | +    <label
 | |
| 63 | +      data-l10n-id="letterboxing-learn-more"
 | |
| 64 | +      class="learnMore text-link"
 | |
| 65 | +      is="text-link"
 | |
| 66 | +      href="about:manual#letterboxing"
 | |
| 67 | +      useoriginprincipal="true"
 | |
| 68 | +    />
 | |
| 69 | +  </description>
 | |
| 70 | +  <description
 | |
| 71 | +    id="letterboxingAlignmentDesc"
 | |
| 72 | +    flex="1"
 | |
| 73 | +    data-l10n-id="letterboxing-alignment-description"
 | |
| 74 | +  />
 | |
| 75 | +  <form
 | |
| 76 | +    xmlns="http://www.w3.org/1999/xhtml"
 | |
| 77 | +    id="letterboxingAligner"
 | |
| 78 | +    autocomplete="off"
 | |
| 79 | +    aria-labelledby="letterboxingAlignmentDesc"
 | |
| 80 | +  >
 | |
| 81 | +    <label class="web-appearance-choice letterboxing-align-top">
 | |
| 82 | +      <div class="web-appearance-choice-image-container">
 | |
| 83 | +        <img role="presentation" />
 | |
| 84 | +      </div>
 | |
| 85 | +      <div class="web-appearance-choice-footer">
 | |
| 86 | +        <input type="radio" name="alignment" value="top" />
 | |
| 87 | +        <span data-l10n-id="letterboxing-alignment-top"></span>
 | |
| 88 | +      </div>
 | |
| 89 | +    </label>
 | |
| 90 | +    <label class="web-appearance-choice letterboxing-align-middle">
 | |
| 91 | +      <div class="web-appearance-choice-image-container">
 | |
| 92 | +        <img role="presentation" />
 | |
| 93 | +      </div>
 | |
| 94 | +      <div class="web-appearance-choice-footer">
 | |
| 95 | +        <input type="radio" name="alignment" value="middle" />
 | |
| 96 | +        <span data-l10n-id="letterboxing-alignment-middle"></span>
 | |
| 97 | +      </div>
 | |
| 98 | +    </label>
 | |
| 99 | +  </form>
 | |
| 100 | +</groupbox>
 | |
| 101 | +<groupbox
 | |
| 102 | +  id="letterboxingDisabled"
 | |
| 103 | +  data-category="paneGeneral"
 | |
| 104 | +  hidden="true"
 | |
| 105 | +>
 | |
| 106 | +  <label class="letterboxing-search-heading"><html:h2
 | |
| 107 | +    data-l10n-id="letterboxing-header"/></label>
 | |
| 108 | +  <description class="letterboxing-search-overview">
 | |
| 109 | +    <html:span
 | |
| 110 | +      data-l10n-id="letterboxing-overview"
 | |
| 111 | +      class="tail-with-learn-more"
 | |
| 112 | +    ></html:span>
 | |
| 113 | +    <label
 | |
| 114 | +      data-l10n-id="letterboxing-learn-more"
 | |
| 115 | +      class="learnMore text-link"
 | |
| 116 | +      is="text-link"
 | |
| 117 | +      href="about:manual#letterboxing"
 | |
| 118 | +      useoriginprincipal="true"
 | |
| 119 | +    />
 | |
| 120 | +  </description>
 | |
| 121 | +  <hbox align="center">
 | |
| 122 | +    <label
 | |
| 123 | +      class="face-sad"
 | |
| 124 | +      flex="1"
 | |
| 125 | +      data-l10n-id="letterboxing-disabled-description"
 | |
| 126 | +    />
 | |
| 127 | +    <button
 | |
| 128 | +      id="letterboxingEnableButton"
 | |
| 129 | +      class="accessory-button"
 | |
| 130 | +      is="highlightable-button"
 | |
| 131 | +      data-l10n-id="letterboxing-enable-button"
 | |
| 132 | +    />
 | |
| 133 | +  </hbox>
 | |
| 134 | +</groupbox> | 
| 1 | +/* import-globals-from /browser/components/preferences/preferences.js */
 | |
| 2 | +/* import-globals-from /browser/components/preferences/findInPage.js */
 | |
| 3 | +/* import-globals-from /toolkit/content/preferencesBindings.js */
 | |
| 4 | + | |
| 5 | +Preferences.addAll([
 | |
| 6 | +  {
 | |
| 7 | +    id: "privacy.resistFingerprinting.letterboxing.rememberSize",
 | |
| 8 | +    type: "bool",
 | |
| 9 | +  },
 | |
| 10 | +]);
 | |
| 11 | + | |
| 12 | +{
 | |
| 13 | +  const lbEnabledPref = "privacy.resistFingerprinting.letterboxing";
 | |
| 14 | +  const visibilityPrefs = ["privacy.resistFingerprinting", lbEnabledPref];
 | |
| 15 | +  const alignMiddlePref = "privacy.resistFingerprinting.letterboxing.vcenter";
 | |
| 16 | + | |
| 17 | +  const hideFromSearchIf = (mustHide, ...elements) => {
 | |
| 18 | +    for (const element of elements) {
 | |
| 19 | +      if (mustHide) {
 | |
| 20 | +        element.setAttribute("data-hidden-from-search", "true");
 | |
| 21 | +      } else {
 | |
| 22 | +        element.removeAttribute("data-hidden-from-search");
 | |
| 23 | +      }
 | |
| 24 | +    }
 | |
| 25 | +  };
 | |
| 26 | + | |
| 27 | +  const syncVisibility = () => {
 | |
| 28 | +    const [rfpEnabled, letterboxingEnabled] = visibilityPrefs.map(pref =>
 | |
| 29 | +      Services.prefs.getBoolPref(pref, false)
 | |
| 30 | +    );
 | |
| 31 | +    const categoryElement = document.getElementById("letterboxingCategory");
 | |
| 32 | +    const { classList } = categoryElement;
 | |
| 33 | + | |
| 34 | +    // Show the letterboxing section only if resistFingerprinting is enabled
 | |
| 35 | +    classList.toggle("rfp-enabled", rfpEnabled);
 | |
| 36 | +    classList.toggle("letterboxing-enabled", letterboxingEnabled);
 | |
| 37 | + | |
| 38 | +    // To ensure the hidden parts do not contribute to search results, we need
 | |
| 39 | +    // to add "data-hidden-from-search".
 | |
| 40 | +    hideFromSearchIf(
 | |
| 41 | +      !rfpEnabled || !letterboxingEnabled,
 | |
| 42 | +      ...document.querySelectorAll(".letterboxing-category")
 | |
| 43 | +    );
 | |
| 44 | +    hideFromSearchIf(
 | |
| 45 | +      !rfpEnabled || letterboxingEnabled,
 | |
| 46 | +      document.getElementById("letterboxingDisabled")
 | |
| 47 | +    );
 | |
| 48 | +  };
 | |
| 49 | + | |
| 50 | +  const onVisibilityPrefChange = () => {
 | |
| 51 | +    syncVisibility();
 | |
| 52 | +    // NOTE: Firefox does not expect "data-hidden-from-search" to change
 | |
| 53 | +    // dynamically after page initialization. So we need to manually recall the
 | |
| 54 | +    // methods that use "data-hidden-from-search". I.e. the "search" method,
 | |
| 55 | +    // using the currently shown category.
 | |
| 56 | +    // NOTE: We skip this if we are just initializing on page load.
 | |
| 57 | +    // NOTE: data-hidden-from-search is also used when the user has entered a
 | |
| 58 | +    // search term. We do not update the results in this case. Instead, it will
 | |
| 59 | +    // update when the search term changes or is cleared.
 | |
| 60 | +    if (!gSearchResultsPane.query) {
 | |
| 61 | +      search(gLastCategory.category, "data-category");
 | |
| 62 | +    }
 | |
| 63 | +  };
 | |
| 64 | + | |
| 65 | +  const alignerId = "letterboxingAligner";
 | |
| 66 | +  const syncAligner = () => {
 | |
| 67 | +    const value = Services.prefs.getBoolPref(alignMiddlePref)
 | |
| 68 | +      ? "middle"
 | |
| 69 | +      : "top";
 | |
| 70 | +    document.querySelector(
 | |
| 71 | +      `#${alignerId} input[value="${value}"]`
 | |
| 72 | +    ).checked = true;
 | |
| 73 | +  };
 | |
| 74 | + | |
| 75 | +  var gLetterboxingPrefs = {
 | |
| 76 | +    init() {
 | |
| 77 | +      syncVisibility();
 | |
| 78 | +      document
 | |
| 79 | +        .getElementById("letterboxingEnableButton")
 | |
| 80 | +        .addEventListener("command", () => {
 | |
| 81 | +          Services.prefs.setBoolPref(lbEnabledPref, true);
 | |
| 82 | +          // Button should have focus when activated but will be hidden now,
 | |
| 83 | +          // so re-assign focus to the newly revealed options.
 | |
| 84 | +          Services.focus.moveFocus(
 | |
| 85 | +            window,
 | |
| 86 | +            document.querySelector(".letterboxing-category"),
 | |
| 87 | +            Services.focus.MOVEFOCUS_FIRST,
 | |
| 88 | +            0
 | |
| 89 | +          );
 | |
| 90 | +        });
 | |
| 91 | +      for (const pref of visibilityPrefs) {
 | |
| 92 | +        Services.prefs.addObserver(pref, onVisibilityPrefChange);
 | |
| 93 | +      }
 | |
| 94 | + | |
| 95 | +      syncAligner();
 | |
| 96 | +      document.getElementById(alignerId).addEventListener("change", e => {
 | |
| 97 | +        // NOTE: the "change" event is only fired on the checked input.
 | |
| 98 | +        Services.prefs.setBoolPref(
 | |
| 99 | +          alignMiddlePref,
 | |
| 100 | +          e.target.value === "middle"
 | |
| 101 | +        );
 | |
| 102 | +      });
 | |
| 103 | +      Services.prefs.addObserver(alignMiddlePref, syncAligner);
 | |
| 104 | +    },
 | |
| 105 | + | |
| 106 | +    destroy() {
 | |
| 107 | +      for (const pref of visibilityPrefs) {
 | |
| 108 | +        Services.prefs.removeObserver(pref, onVisibilityPrefChange);
 | |
| 109 | +      }
 | |
| 110 | +      Services.prefs.removeObserver(alignMiddlePref, syncAligner);
 | |
| 111 | +    },
 | |
| 112 | +  };
 | |
| 113 | +} | 
| ... | ... | @@ -130,6 +130,9 @@ | 
| 130 | 130 |      </vbox>
 | 
| 131 | 131 |  </groupbox>
 | 
| 132 | 132 | |
| 133 | +<!-- Letterboxing -->
 | |
| 134 | +#include ./letterboxing.inc.xhtml
 | |
| 135 | + | |
| 133 | 136 |  <hbox id="languageAndAppearanceCategory"
 | 
| 134 | 137 |        class="subcategory"
 | 
| 135 | 138 |        hidden="true"
 | 
| ... | ... | @@ -729,6 +729,7 @@ var gMainPane = { | 
| 729 | 729 |      ]);
 | 
| 730 | 730 | |
| 731 | 731 |      AppearanceChooser.init();
 | 
| 732 | +    gLetterboxingPrefs.init();
 | |
| 732 | 733 | |
| 733 | 734 |      // Notify observers that the UI is now ready
 | 
| 734 | 735 |      Services.obs.notifyObservers(window, "main-pane-loaded");
 | 
| ... | ... | @@ -2585,6 +2586,7 @@ var gMainPane = { | 
| 2585 | 2586 |      Services.prefs.removeObserver(PREF_CONTAINERS_EXTENSION, this);
 | 
| 2586 | 2587 |      Services.obs.removeObserver(this, AUTO_UPDATE_CHANGED_TOPIC);
 | 
| 2587 | 2588 |      Services.obs.removeObserver(this, BACKGROUND_UPDATE_CHANGED_TOPIC);
 | 
| 2589 | +    gLetterboxingPrefs.destroy();
 | |
| 2588 | 2590 |      AppearanceChooser.destroy();
 | 
| 2589 | 2591 |    },
 | 
| 2590 | 2592 | 
| ... | ... | @@ -12,6 +12,7 @@ | 
| 12 | 12 |  <?xml-stylesheet href="chrome://browser/skin/preferences/search.css"?>
 | 
| 13 | 13 |  <?xml-stylesheet href="chrome://browser/skin/preferences/containers.css"?>
 | 
| 14 | 14 |  <?xml-stylesheet href="chrome://browser/skin/preferences/privacy.css"?>
 | 
| 15 | +<?xml-stylesheet href="chrome://browser/content/preferences/letterboxing.css"?>
 | |
| 15 | 16 |  <?xml-stylesheet href="chrome://browser/content/securitylevel/securityLevelPreferences.css"?>
 | 
| 16 | 17 |  <?xml-stylesheet href="chrome://browser/content/torpreferences/torPreferences.css"?>
 | 
| 17 | 18 |  <?xml-stylesheet href="chrome://browser/content/onionservices/authPreferences.css"?>
 | 
| ... | ... | @@ -42,6 +43,7 @@ | 
| 42 | 43 | |
| 43 | 44 |    <!-- Links below are only used for search-l10n-ids into subdialogs -->
 | 
| 44 | 45 |    <link rel="localization" href="browser/aboutDialog.ftl"/>
 | 
| 46 | +  <link rel="localization" href="browser/base-browser.ftl"/>
 | |
| 45 | 47 |    <link rel="localization" href="browser/preferences/addEngine.ftl"/>
 | 
| 46 | 48 |    <link rel="localization" href="browser/preferences/blocklists.ftl"/>
 | 
| 47 | 49 |    <link rel="localization" href="browser/preferences/clearSiteData.ftl"/>
 | 
| ... | ... | @@ -70,3 +70,27 @@ new-identity-dialog-confirm = | 
| 70 | 70 |  new-identity-blocked-home-notification = { -brand-short-name } blocked your homepage ({ $url }) from loading because it might recognize your previous session.
 | 
| 71 | 71 |  # Button to continue loading the home page, despite the warning message.
 | 
| 72 | 72 |  new-identity-blocked-home-ignore-button = Load it anyway
 | 
| 73 | +## Preferences - Letterboxing.
 | |
| 74 | + | |
| 75 | +# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
 | |
| 76 | +# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
 | |
| 77 | +letterboxing-header = Letterboxing
 | |
| 78 | +# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
 | |
| 79 | +# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
 | |
| 80 | +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.
 | |
| 81 | +letterboxing-learn-more = Learn more
 | |
| 82 | +letterboxing-window-size-header = Window size
 | |
| 83 | +letterboxing-remember-size =
 | |
| 84 | +    .label = Reuse last window size when opening a new window
 | |
| 85 | +    .accesskey = R
 | |
| 86 | +letterboxing-alignment-header = Content Alignment
 | |
| 87 | +letterboxing-alignment-description = Choose where you want to align the website’s content.
 | |
| 88 | +letterboxing-alignment-top = Top
 | |
| 89 | +letterboxing-alignment-middle = Middle
 | |
| 90 | +# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
 | |
| 91 | +# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
 | |
| 92 | +letterboxing-disabled-description = Letterboxing is currently disabled.
 | |
| 93 | +# The word "Letterboxing" is the proper noun for the Tor Browser feature, and is therefore capitalised.
 | |
| 94 | +# "Letterboxing" should be treated as a feature/product name, and likely not changed in other languages.
 | |
| 95 | +letterboxing-enable-button =
 | |
| 96 | +    .label = Enable Letterboxing |