morgan pushed to branch base-browser-140.4.0esr-15.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
8f0da14a
by Henry Wilkes at 2025-10-13T14:45:19+00:00
-
c6268111
by Henry Wilkes at 2025-10-13T14:45:19+00:00
-
687cbb65
by Henry Wilkes at 2025-10-13T14:45:20+00:00
-
9f7ddf7e
by Henry Wilkes at 2025-10-13T14:45:20+00:00
5 changed files:
- browser/app/profile/001-base-profile.js
- browser/components/ProfileDataUpgrader.sys.mjs
- browser/components/preferences/main.inc.xhtml
- browser/components/preferences/main.js
- toolkit/locales/en-US/toolkit/global/base-browser.ftl
Changes:
| ... | ... | @@ -544,7 +544,13 @@ pref("pdfjs.enableScripting", false); |
| 544 | 544 | // tor-browser#42255: pdfjs.disabled used to be part of RFP until Bug 1838415; lock pref to false in stable
|
| 545 | 545 | pref("pdfjs.disabled", false, locked);
|
| 546 | 546 | #endif
|
| 547 | -// Bug 40057: Ensure system colors are not used for CSS4 colors
|
|
| 547 | +// tor-browser#43850. Keep forced colors off by default for all platforms.
|
|
| 548 | +// Upstream sets a value of "0" for Windows.
|
|
| 549 | +pref("browser.display.document_color_use", 1);
|
|
| 550 | +// Bug 40057: Ensure system colors are not used for CSS4 colors.
|
|
| 551 | +// FIXME: This preference seems to be unread since bugzilla bug 1898096, but
|
|
| 552 | +// still exists in the static preference list. Remove when upstream removes
|
|
| 553 | +// this or confirms it will not be used again in the future.
|
|
| 548 | 554 | pref("browser.display.use_system_colors", false);
|
| 549 | 555 | // tor-browser#43366: do not use system accent color in inputs.
|
| 550 | 556 | // See also https://bugzilla.mozilla.org/show_bug.cgi?id=1861362.
|
| ... | ... | @@ -914,7 +914,8 @@ export let ProfileDataUpgrader = { |
| 914 | 914 | // Version 3: 14.0a7: Reset general.smoothScroll. tor-browser#42070.
|
| 915 | 915 | // Version 4: 15.0a2: Drop ML components. tor-browser#44045.
|
| 916 | 916 | // Version 5: 15.0a3: Disable LaterRun using prefs. tor-browser#42630.
|
| 917 | - const MIGRATION_VERSION = 5;
|
|
| 917 | + // Version 6: 15.0a4: Reset browser colors. tor-browser#43850.
|
|
| 918 | + const MIGRATION_VERSION = 6;
|
|
| 918 | 919 | const MIGRATION_PREF = "basebrowser.migration.version";
|
| 919 | 920 | |
| 920 | 921 | if (isNewProfile) {
|
| ... | ... | @@ -982,6 +983,36 @@ export let ProfileDataUpgrader = { |
| 982 | 983 | Services.prefs.clearUserPref(prefName);
|
| 983 | 984 | }
|
| 984 | 985 | }
|
| 986 | + if (currentVersion < 6) {
|
|
| 987 | + // Clear the related preference that is no longer read by upstream's code.
|
|
| 988 | + Services.prefs.clearUserPref("browser.display.use_system_colors");
|
|
| 989 | + if (Services.prefs.getBoolPref("privacy.resistFingerprinting", true)) {
|
|
| 990 | + for (const prefName of [
|
|
| 991 | + // User has not switched off resist fingerprinting. We want to reset
|
|
| 992 | + // any "0" (automatic, use system colours) and "2" (always use browser
|
|
| 993 | + // colours) values.
|
|
| 994 | + // The "0" value cannot be set by the user under RFP in
|
|
| 995 | + // about:preferences. The "2" value can be set, but has a different
|
|
| 996 | + // name and a warning about website detectability. tor-browser#43850.
|
|
| 997 | + "browser.display.document_color_use",
|
|
| 998 | + // Under RFP, the following colours are ignored. So we clear them.
|
|
| 999 | + // NOTE: Only a subset of can be set via the colors.xhtml dialog in
|
|
| 1000 | + // about:preferences.
|
|
| 1001 | + "browser.anchor_color",
|
|
| 1002 | + "browser.anchor_color.dark",
|
|
| 1003 | + "browser.visited_color",
|
|
| 1004 | + "browser.visited_color.dark",
|
|
| 1005 | + "browser.display.foreground_color",
|
|
| 1006 | + "browser.display.foreground_color.dark",
|
|
| 1007 | + "browser.display.background_color",
|
|
| 1008 | + "browser.display.background_color.dark",
|
|
| 1009 | + "browser.active_color",
|
|
| 1010 | + "browser.active_color.dark",
|
|
| 1011 | + ]) {
|
|
| 1012 | + Services.prefs.clearUserPref(prefName);
|
|
| 1013 | + }
|
|
| 1014 | + }
|
|
| 1015 | + }
|
|
| 985 | 1016 | Services.prefs.setIntPref(MIGRATION_PREF, MIGRATION_VERSION);
|
| 986 | 1017 | },
|
| 987 | 1018 | }; |
| ... | ... | @@ -264,6 +264,15 @@ |
| 264 | 264 | value="2"
|
| 265 | 265 | flex="1"
|
| 266 | 266 | data-l10n-id="preferences-contrast-control-custom"/>
|
| 267 | + <description id="contrastSettingsFixedColorsDescription" class="indent">
|
|
| 268 | + <html:span
|
|
| 269 | + data-l10n-id="preferences-contrast-control-fixed-color-description"
|
|
| 270 | + ></html:span>
|
|
| 271 | + <html:a
|
|
| 272 | + is="moz-support-link"
|
|
| 273 | + tor-manual-page="anti-fingerprinting"
|
|
| 274 | + ></html:a>
|
|
| 275 | + </description>
|
|
| 267 | 276 | <button id="colors"
|
| 268 | 277 | is="highlightable-button"
|
| 269 | 278 | class="accessory-button indent"
|
| ... | ... | @@ -733,6 +733,78 @@ var gMainPane = { |
| 733 | 733 | gMainPane.updateColorsButton.bind(gMainPane)
|
| 734 | 734 | );
|
| 735 | 735 | gMainPane.updateColorsButton();
|
| 736 | + |
|
| 737 | + // Modify the contrast setting options when resist fingerprinting (RFP) is
|
|
| 738 | + // enabled because the custom colours will not be used in this state.
|
|
| 739 | + // Instead, some fixed set of stand-in colours is used. tor-browser#43850.
|
|
| 740 | + const resistFingerprintingPref = "privacy.resistFingerprinting";
|
|
| 741 | + const updateContrastControls = () => {
|
|
| 742 | + const rfpEnabled = Services.prefs.getBoolPref(
|
|
| 743 | + resistFingerprintingPref,
|
|
| 744 | + false
|
|
| 745 | + );
|
|
| 746 | + const autoOptionEl = document.getElementById("contrastSettingsAuto");
|
|
| 747 | + const onOptionEl = document.getElementById("contrastSettingsOn");
|
|
| 748 | + const onDescriptionEl = document.getElementById(
|
|
| 749 | + "contrastSettingsFixedColorsDescription"
|
|
| 750 | + );
|
|
| 751 | + const colorButtonEl = document.getElementById("colors");
|
|
| 752 | + for (const { element, hide } of [
|
|
| 753 | + {
|
|
| 754 | + element: autoOptionEl,
|
|
| 755 | + // Hide the "Automatic" option under RFP if it is not already
|
|
| 756 | + // selected. We generally want to discourage this reflection of system
|
|
| 757 | + // settings if RFP is enabled.
|
|
| 758 | + // NOTE: It would be unexpected for this value to be selected under
|
|
| 759 | + // RFP since there is no visible UI to do so in this state. It would
|
|
| 760 | + // likely require some direct preference manipulation.
|
|
| 761 | + hide:
|
|
| 762 | + rfpEnabled &&
|
|
| 763 | + autoOptionEl.value !==
|
|
| 764 | + String(
|
|
| 765 | + Preferences.get("browser.display.document_color_use").value
|
|
| 766 | + ),
|
|
| 767 | + },
|
|
| 768 | + { element: colorButtonEl, hide: rfpEnabled },
|
|
| 769 | + { element: onDescriptionEl, hide: !rfpEnabled },
|
|
| 770 | + ]) {
|
|
| 771 | + element.hidden = hide;
|
|
| 772 | + if (hide) {
|
|
| 773 | + element.setAttribute("data-hidden-from-search", "true");
|
|
| 774 | + } else {
|
|
| 775 | + element.removeAttribute("data-hidden-from-search");
|
|
| 776 | + }
|
|
| 777 | + }
|
|
| 778 | + if (rfpEnabled) {
|
|
| 779 | + onOptionEl.setAttribute(
|
|
| 780 | + "data-l10n-id",
|
|
| 781 | + "preferences-contrast-control-fixed-color"
|
|
| 782 | + );
|
|
| 783 | + onOptionEl.setAttribute("aria-describedby", onDescriptionEl.id);
|
|
| 784 | + } else {
|
|
| 785 | + onOptionEl.setAttribute(
|
|
| 786 | + "data-l10n-id",
|
|
| 787 | + "preferences-contrast-control-custom"
|
|
| 788 | + );
|
|
| 789 | + onOptionEl.removeAttribute("aria-describedby");
|
|
| 790 | + }
|
|
| 791 | + };
|
|
| 792 | + updateContrastControls();
|
|
| 793 | + Services.prefs.addObserver(
|
|
| 794 | + resistFingerprintingPref,
|
|
| 795 | + updateContrastControls
|
|
| 796 | + );
|
|
| 797 | + window.addEventListener(
|
|
| 798 | + "unload",
|
|
| 799 | + () => {
|
|
| 800 | + Services.prefs.removeObserver(
|
|
| 801 | + resistFingerprintingPref,
|
|
| 802 | + updateContrastControls
|
|
| 803 | + );
|
|
| 804 | + },
|
|
| 805 | + { once: true }
|
|
| 806 | + );
|
|
| 807 | + |
|
| 736 | 808 | Preferences.get("layers.acceleration.disabled").on(
|
| 737 | 809 | "change",
|
| 738 | 810 | gMainPane.updateHardwareAcceleration.bind(gMainPane)
|
| ... | ... | @@ -101,6 +101,13 @@ letterboxing-enable-button = |
| 101 | 101 | |
| 102 | 102 | browser-layout-show-sidebar-desc-limited = Quickly access bookmarks and more without leaving your main view.
|
| 103 | 103 | |
| 104 | +## Preferences - Contrast Control.
|
|
| 105 | + |
|
| 106 | +preferences-contrast-control-fixed-color =
|
|
| 107 | + .label = Fixed colors
|
|
| 108 | + .accesskey = F
|
|
| 109 | +preferences-contrast-control-fixed-color-description = This will be detectable by websites and will make you appear more unique to web trackers.
|
|
| 110 | + |
|
| 104 | 111 | ## Security level toolbar button.
|
| 105 | 112 | ## Uses sentence case in English (US).
|
| 106 | 113 | ## ".label" is the accessible name, and shown in the overflow menu and when customizing the toolbar.
|