morgan pushed to branch tor-browser-153.1.0esr-16.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
8eb85eec
by Henry Wilkes at 2026-08-24T13:07:13+00:00
-
108ff310
by Henry Wilkes at 2026-08-24T13:07:13+00:00
-
1ab24002
by Henry Wilkes at 2026-08-24T13:07:13+00:00
6 changed files:
- browser/base/content/languageNotification.js
- browser/components/preferences/config/languages.mjs
- browser/components/preferences/findInPage.js
- browser/components/preferences/main.inc.xhtml
- browser/components/preferences/preferences.js
- browser/components/torpreferences/config/connection.mjs
Changes:
| ... | ... | @@ -46,7 +46,7 @@ window.addEventListener("load", () => { |
| 46 | 46 | {
|
| 47 | 47 | "l10n-id": "language-notification-button",
|
| 48 | 48 | callback() {
|
| 49 | - openPreferences("general-language");
|
|
| 49 | + openPreferences("languages-browser-languages");
|
|
| 50 | 50 | },
|
| 51 | 51 | },
|
| 52 | 52 | ];
|
| ... | ... | @@ -862,6 +862,7 @@ SettingGroupManager.registerGroups({ |
| 862 | 862 | inProgress: true,
|
| 863 | 863 | l10nId: "browser-language-heading",
|
| 864 | 864 | headingLevel: 2,
|
| 865 | + subcategory: "browser-languages",
|
|
| 865 | 866 | iconSrc: "chrome://browser/skin/sidebar/firefox.svg",
|
| 866 | 867 | items: [
|
| 867 | 868 | {
|
| ... | ... | @@ -72,7 +72,11 @@ var gSearchResultsPane = { |
| 72 | 72 | this.searchInput.addEventListener("input", this);
|
| 73 | 73 | window.addEventListener("DOMContentLoaded", () => {
|
| 74 | 74 | this.searchInput.updateComplete.then(() => {
|
| 75 | - this.searchInput.focus();
|
|
| 75 | + // To avoid a race with `scrollAndHighlight`, we only move the focus
|
|
| 76 | + // if it remains at the top of the document. tor-browser#43640.
|
|
| 77 | + if (document.activeElement === document.body) {
|
|
| 78 | + this.searchInput.focus();
|
|
| 79 | + }
|
|
| 76 | 80 | });
|
| 77 | 81 | // Initialize other panes in an idle callback.
|
| 78 | 82 | window.requestIdleCallback(() => this.initializeCategories());
|
| ... | ... | @@ -65,7 +65,7 @@ |
| 65 | 65 | <!-- Languages -->
|
| 66 | 66 | <html:setting-group groupid="browserLanguage" data-srd-migrated="" hidden="true" data-category="paneGeneral"></html:setting-group>
|
| 67 | 67 | <html:setting-group groupid="websiteLanguage" data-srd-migrated="" hidden="true" data-category="paneGeneral"></html:setting-group>
|
| 68 | -<groupbox id="languagesGroup" data-category="paneGeneral" hidden="true" data-subcategory="language" data-srd-groupid="browserLanguage">
|
|
| 68 | +<groupbox id="languagesGroup" data-category="paneGeneral" hidden="true" data-srd-groupid="browserLanguage">
|
|
| 69 | 69 | <label><html:h2 data-l10n-id="language-header"/></label>
|
| 70 | 70 | |
| 71 | 71 | <vbox id="browserLanguagesBox" align="start" hidden="true">
|
| ... | ... | @@ -994,24 +994,28 @@ function scrollAndHighlight(subcategory) { |
| 994 | 994 | return;
|
| 995 | 995 | }
|
| 996 | 996 | |
| 997 | - // We assign a tabindex=-1 to the element so that we can focus it. This allows
|
|
| 998 | - // us to move screen reader's focus to an arbitrary position on the page.
|
|
| 999 | - // See tor-browser#41454 and mozilla bug 1799153.
|
|
| 1000 | - const doFocus = () => {
|
|
| 1001 | - elements[0].setAttribute("tabindex", "-1");
|
|
| 1002 | - Services.focus.setFocus(elements[0], Services.focus.FLAG_NOSCROLL);
|
|
| 1003 | - // Immediately remove again now that it has focus.
|
|
| 1004 | - elements[0].removeAttribute("tabindex");
|
|
| 1005 | - };
|
|
| 1006 | - // The element is not always immediately focusable, so we wait until document
|
|
| 1007 | - // load.
|
|
| 1008 | - if (document.readyState === "complete") {
|
|
| 1009 | - doFocus();
|
|
| 997 | + // We focus the first element that we can focus.
|
|
| 998 | + // See tor-browser#41454, tor-browser#45195 and mozilla bug 1799153.
|
|
| 999 | + let focusTarget = elements[0];
|
|
| 1000 | + if (focusTarget.tagName === "setting-group") {
|
|
| 1001 | + focusTarget = focusTarget.fieldsetEl;
|
|
| 1002 | + // Make the heading focusable.
|
|
| 1003 | + focusTarget.focusableHeading = true;
|
|
| 1004 | + focusTarget.updateComplete.then(() => {
|
|
| 1005 | + focusTarget.focusHeading();
|
|
| 1006 | + });
|
|
| 1010 | 1007 | } else {
|
| 1011 | - // Wait until document load to move focus.
|
|
| 1012 | - // NOTE: This should be called after DOMContentLoaded, where the searchInput
|
|
| 1013 | - // is focused.
|
|
| 1014 | - window.addEventListener("load", doFocus, { once: true });
|
|
| 1008 | + // Try focus directly using the focus method, which can be overridden.
|
|
| 1009 | + focusTarget.focus();
|
|
| 1010 | + if (!focusTarget.contains(document.activeElement)) {
|
|
| 1011 | + // Else, try focus the first focusable target.
|
|
| 1012 | + Services.focus.moveFocus(
|
|
| 1013 | + window,
|
|
| 1014 | + focusTarget,
|
|
| 1015 | + Services.focus.MOVEFOCUS_FIRST,
|
|
| 1016 | + Services.focus.FLAG_NOSCROLL
|
|
| 1017 | + );
|
|
| 1018 | + }
|
|
| 1015 | 1019 | }
|
| 1016 | 1020 | |
| 1017 | 1021 | elements[0].scrollIntoView({
|
| ... | ... | @@ -205,6 +205,7 @@ SettingGroupManager.registerGroups({ |
| 205 | 205 | },
|
| 206 | 206 | {
|
| 207 | 207 | id: "torViewLog",
|
| 208 | + subcategory: "viewlogs",
|
|
| 208 | 209 | l10nId: "tor-view-log-button2",
|
| 209 | 210 | control: "moz-box-button",
|
| 210 | 211 | },
|