ma1 pushed to branch tor-browser-115.11.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits: d018a7b3 by Henry Wilkes at 2024-05-16T13:03:37+00:00 fixup! Bug 41916: Letterboxing preferences UI
Bug 42583: Use moz-support-link for the letterboxing preference.
Also update the url.
- - - - - db143d45 by Henry Wilkes at 2024-05-16T13:03:37+00:00 fixup! Bug 40925: Implemented the Security Level component
Bug 42583: Use moz-support-link for the security level "Learn more" links. These take you to the tor project web link in base browser.
- - - - - 7c7573c4 by Henry Wilkes at 2024-05-16T13:03:37+00:00 Bug 42583: Modify moz-support-link for Base Browser.
- - - - - c6a32aa5 by Henry Wilkes at 2024-05-16T13:03:37+00:00 fixup! Bug 2176: Rebrand Firefox to TorBrowser
Bug 42583: Move moz-support-link change out of the branding commit.
- - - - - c5ee42b4 by Henry Wilkes at 2024-05-16T13:03:37+00:00 Bug 42583: Modify moz-support-link for Tor Browser.
- - - - -
5 changed files:
- browser/components/preferences/letterboxing.inc.xhtml - browser/components/securitylevel/content/securityLevel.js - browser/components/securitylevel/content/securityLevelPanel.inc.xhtml - browser/components/securitylevel/content/securityLevelPreferences.inc.xhtml - toolkit/content/widgets/moz-support-link/moz-support-link.mjs
Changes:
===================================== browser/components/preferences/letterboxing.inc.xhtml ===================================== @@ -11,13 +11,11 @@ data-l10n-id="letterboxing-overview" class="tail-with-learn-more" ></html:span> - <label + <html:a + is="moz-support-link" + tor-manual-page="anti-fingerprinting_letterboxing" data-l10n-id="letterboxing-learn-more" - class="learnMore text-link" - is="text-link" - href="about:manual#letterboxing" - useoriginprincipal="true" - /> + ></html:a> </description> </vbox> <groupbox @@ -32,13 +30,11 @@ data-l10n-id="letterboxing-overview" class="tail-with-learn-more" ></html:span> - <label + <html:a + is="moz-support-link" + tor-manual-page="anti-fingerprinting_letterboxing" data-l10n-id="letterboxing-learn-more" - class="learnMore text-link" - is="text-link" - href="about:manual#letterboxing" - useoriginprincipal="true" - /> + ></html:a> </description> <checkbox id="letterboxingRememberSize" @@ -59,13 +55,11 @@ data-l10n-id="letterboxing-overview" class="tail-with-learn-more" ></html:span> - <label + <html:a + is="moz-support-link" + tor-manual-page="anti-fingerprinting_letterboxing" data-l10n-id="letterboxing-learn-more" - class="learnMore text-link" - is="text-link" - href="about:manual#letterboxing" - useoriginprincipal="true" - /> + ></html:a> </description> <description id="letterboxingAlignmentDesc" @@ -110,13 +104,11 @@ data-l10n-id="letterboxing-overview" class="tail-with-learn-more" ></html:span> - <label + <html:a + is="moz-support-link" + tor-manual-page="anti-fingerprinting_letterboxing" data-l10n-id="letterboxing-learn-more" - class="learnMore text-link" - is="text-link" - href="about:manual#letterboxing" - useoriginprincipal="true" - /> + ></html:a> </description> <hbox align="center"> <label
===================================== browser/components/securitylevel/content/securityLevel.js ===================================== @@ -157,6 +157,9 @@ var SecurityLevelPanel = { _populated: false,
_populateXUL() { + // TODO: Used for #securityLevel-learnMore. Remove with esr 128. + window.ensureCustomElements("moz-support-link"); + this._elements = { panel: document.getElementById("securityLevel-panel"), background: document.getElementById("securityLevel-background"), @@ -171,9 +174,7 @@ var SecurityLevelPanel = {
const learnMoreEl = document.getElementById("securityLevel-learnMore"); learnMoreEl.addEventListener("click", event => { - window.openTrustedLinkIn(learnMoreEl.href, "tab"); this.hide(); - event.preventDefault(); });
this._elements.restoreDefaultsButton.addEventListener("command", () => {
===================================== browser/components/securitylevel/content/securityLevelPanel.inc.xhtml ===================================== @@ -23,9 +23,10 @@ </html:p> <html:p id="securityLevel-summary"></html:p> <html:a + is="moz-support-link" id="securityLevel-learnMore" + tor-manual-page="security-settings" data-l10n-id="security-level-panel-learn-more-link" - href="about:manual#security-settings" ></html:a> </vbox> <hbox class="panel-footer">
===================================== browser/components/securitylevel/content/securityLevelPreferences.inc.xhtml ===================================== @@ -12,14 +12,11 @@ class="tail-with-learn-more" data-l10n-id="security-level-preferences-overview" ></html:span> - <label - id="securityLevel-learnMore" - class="learnMore text-link" - is="text-link" + <html:a + is="moz-support-link" + tor-manual-page="security-settings" data-l10n-id="security-level-preferences-learn-more-link" - href="about:manual#security-settings" - useoriginprincipal="true" - /> + ></html:a> </description> <hbox id="securityLevel-customNotification"
===================================== toolkit/content/widgets/moz-support-link/moz-support-link.mjs ===================================== @@ -17,7 +17,9 @@ MozXULElement.insertFTLIfNeeded("browser/components/mozSupportLink.ftl"); export default class MozSupportLink extends HTMLAnchorElement { static SUPPORT_URL = "https://www.mozilla.org/"; static get observedAttributes() { - return ["support-page", "utm-content"]; + // We add tor-manual-page for pages hosted at tor project. Also shared with + // base-browser/mullvad-browser. See tor-browser#42583. + return ["support-page", "utm-content", "tor-manual-page"]; }
/** @@ -96,12 +98,21 @@ export default class MozSupportLink extends HTMLAnchorElement { }
attributeChangedCallback(attrName, oldVal, newVal) { - if (attrName === "support-page" || attrName === "utm-content") { + if ( + attrName === "support-page" || + attrName === "utm-content" || + attrName === "tor-manual-page" + ) { this.#setHref(); } }
#setHref() { + let torManualPage = this.getAttribute("tor-manual-page"); + if (torManualPage) { + this.href = `about:manual#${torManualPage}`; + return; + } let supportPage = this.getAttribute("support-page") ?? ""; // For tor-browser we sometimes want to override firefox support links with // our own. @@ -112,7 +123,7 @@ export default class MozSupportLink extends HTMLAnchorElement { // Instead of directing to support for preferences, we link to general // tor browser support. // See tor-browser#32092. - this.href = "https://support.torproject.org/tbb" + this.href = "https://support.torproject.org/tbb"; return; // Fall through to support.mozilla.org } @@ -135,21 +146,7 @@ customElements.define("moz-support-link", MozSupportLink, { extends: "a" }); * Otherwise the url in unmodified form. */ export function formatUTMParams(contentAttribute, url) { - if (!contentAttribute) { - return url; - } - let parsedUrl = new URL(url); - let domain = `.${parsedUrl.hostname}`; - if ( - !domain.endsWith(".mozilla.org") && - // For testing: addons-dev.allizom.org and addons.allizom.org - !domain.endsWith(".allizom.org") - ) { - return url; - } - - parsedUrl.searchParams.set("utm_source", "firefox-browser"); - parsedUrl.searchParams.set("utm_medium", "firefox-browser"); - parsedUrl.searchParams.set("utm_content", contentAttribute); - return parsedUrl.href; + // Do not add utm parameters. See tor-browser#42583. + // NOTE: This method is also present in about:addons. + return url; }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/4a1e3ba...