ma1 pushed to branch mullvad-browser-115.11.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser
Commits:
-
334f5c22
by Henry Wilkes at 2024-05-16T15:56:19+02:00
-
cfddacb5
by Henry Wilkes at 2024-05-16T16:11:27+02:00
-
adcbe40d
by Henry Wilkes at 2024-05-16T16:12:08+02:00
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:
... | ... | @@ -11,13 +11,11 @@ |
11 | 11 | data-l10n-id="letterboxing-overview"
|
12 | 12 | class="tail-with-learn-more"
|
13 | 13 | ></html:span>
|
14 | - <label
|
|
14 | + <html:a
|
|
15 | + is="moz-support-link"
|
|
16 | + tor-manual-page="anti-fingerprinting_letterboxing"
|
|
15 | 17 | data-l10n-id="letterboxing-learn-more"
|
16 | - class="learnMore text-link"
|
|
17 | - is="text-link"
|
|
18 | - href="about:manual#letterboxing"
|
|
19 | - useoriginprincipal="true"
|
|
20 | - />
|
|
18 | + ></html:a>
|
|
21 | 19 | </description>
|
22 | 20 | </vbox>
|
23 | 21 | <groupbox
|
... | ... | @@ -32,13 +30,11 @@ |
32 | 30 | data-l10n-id="letterboxing-overview"
|
33 | 31 | class="tail-with-learn-more"
|
34 | 32 | ></html:span>
|
35 | - <label
|
|
33 | + <html:a
|
|
34 | + is="moz-support-link"
|
|
35 | + tor-manual-page="anti-fingerprinting_letterboxing"
|
|
36 | 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 | - />
|
|
37 | + ></html:a>
|
|
42 | 38 | </description>
|
43 | 39 | <checkbox
|
44 | 40 | id="letterboxingRememberSize"
|
... | ... | @@ -59,13 +55,11 @@ |
59 | 55 | data-l10n-id="letterboxing-overview"
|
60 | 56 | class="tail-with-learn-more"
|
61 | 57 | ></html:span>
|
62 | - <label
|
|
58 | + <html:a
|
|
59 | + is="moz-support-link"
|
|
60 | + tor-manual-page="anti-fingerprinting_letterboxing"
|
|
63 | 61 | data-l10n-id="letterboxing-learn-more"
|
64 | - class="learnMore text-link"
|
|
65 | - is="text-link"
|
|
66 | - href="about:manual#letterboxing"
|
|
67 | - useoriginprincipal="true"
|
|
68 | - />
|
|
62 | + ></html:a>
|
|
69 | 63 | </description>
|
70 | 64 | <description
|
71 | 65 | id="letterboxingAlignmentDesc"
|
... | ... | @@ -110,13 +104,11 @@ |
110 | 104 | data-l10n-id="letterboxing-overview"
|
111 | 105 | class="tail-with-learn-more"
|
112 | 106 | ></html:span>
|
113 | - <label
|
|
107 | + <html:a
|
|
108 | + is="moz-support-link"
|
|
109 | + tor-manual-page="anti-fingerprinting_letterboxing"
|
|
114 | 110 | data-l10n-id="letterboxing-learn-more"
|
115 | - class="learnMore text-link"
|
|
116 | - is="text-link"
|
|
117 | - href="about:manual#letterboxing"
|
|
118 | - useoriginprincipal="true"
|
|
119 | - />
|
|
111 | + ></html:a>
|
|
120 | 112 | </description>
|
121 | 113 | <hbox align="center">
|
122 | 114 | <label
|
... | ... | @@ -157,6 +157,9 @@ var SecurityLevelPanel = { |
157 | 157 | _populated: false,
|
158 | 158 | |
159 | 159 | _populateXUL() {
|
160 | + // TODO: Used for #securityLevel-learnMore. Remove with esr 128.
|
|
161 | + window.ensureCustomElements("moz-support-link");
|
|
162 | + |
|
160 | 163 | this._elements = {
|
161 | 164 | panel: document.getElementById("securityLevel-panel"),
|
162 | 165 | background: document.getElementById("securityLevel-background"),
|
... | ... | @@ -171,9 +174,7 @@ var SecurityLevelPanel = { |
171 | 174 | |
172 | 175 | const learnMoreEl = document.getElementById("securityLevel-learnMore");
|
173 | 176 | learnMoreEl.addEventListener("click", event => {
|
174 | - window.openTrustedLinkIn(learnMoreEl.href, "tab");
|
|
175 | 177 | this.hide();
|
176 | - event.preventDefault();
|
|
177 | 178 | });
|
178 | 179 | |
179 | 180 | this._elements.restoreDefaultsButton.addEventListener("command", () => {
|
... | ... | @@ -23,9 +23,10 @@ |
23 | 23 | </html:p>
|
24 | 24 | <html:p id="securityLevel-summary"></html:p>
|
25 | 25 | <html:a
|
26 | + is="moz-support-link"
|
|
26 | 27 | id="securityLevel-learnMore"
|
28 | + tor-manual-page="security-settings"
|
|
27 | 29 | data-l10n-id="security-level-panel-learn-more-link"
|
28 | - href="">"https://mullvad.net/en/browser/hard-facts#security-levels"
|
|
29 | 30 | ></html:a>
|
30 | 31 | </vbox>
|
31 | 32 | <hbox class="panel-footer">
|
... | ... | @@ -12,13 +12,11 @@ |
12 | 12 | class="tail-with-learn-more"
|
13 | 13 | data-l10n-id="security-level-preferences-overview"
|
14 | 14 | ></html:span>
|
15 | - <label
|
|
16 | - id="securityLevel-learnMore"
|
|
17 | - class="learnMore text-link"
|
|
18 | - is="text-link"
|
|
15 | + <html:a
|
|
16 | + is="moz-support-link"
|
|
17 | + tor-manual-page="security-settings"
|
|
19 | 18 | data-l10n-id="security-level-preferences-learn-more-link"
|
20 | - href="">"https://mullvad.net/en/browser/hard-facts#security-levels"
|
|
21 | - />
|
|
19 | + ></html:a>
|
|
22 | 20 | </description>
|
23 | 21 | <hbox
|
24 | 22 | id="securityLevel-customNotification"
|
... | ... | @@ -17,7 +17,9 @@ MozXULElement.insertFTLIfNeeded("browser/components/mozSupportLink.ftl"); |
17 | 17 | export default class MozSupportLink extends HTMLAnchorElement {
|
18 | 18 | static SUPPORT_URL = "https://www.mozilla.org/";
|
19 | 19 | static get observedAttributes() {
|
20 | - return ["support-page", "utm-content"];
|
|
20 | + // We add tor-manual-page for pages hosted at tor project. Also shared with
|
|
21 | + // base-browser/mullvad-browser. See tor-browser#42583.
|
|
22 | + return ["support-page", "utm-content", "tor-manual-page"];
|
|
21 | 23 | }
|
22 | 24 | |
23 | 25 | /**
|
... | ... | @@ -96,12 +98,33 @@ export default class MozSupportLink extends HTMLAnchorElement { |
96 | 98 | }
|
97 | 99 | |
98 | 100 | attributeChangedCallback(attrName, oldVal, newVal) {
|
99 | - if (attrName === "support-page" || attrName === "utm-content") {
|
|
101 | + if (
|
|
102 | + attrName === "support-page" ||
|
|
103 | + attrName === "utm-content" ||
|
|
104 | + attrName === "tor-manual-page"
|
|
105 | + ) {
|
|
100 | 106 | this.#setHref();
|
101 | 107 | }
|
102 | 108 | }
|
103 | 109 | |
104 | 110 | #setHref() {
|
111 | + let torManualPage = this.getAttribute("tor-manual-page");
|
|
112 | + if (torManualPage) {
|
|
113 | + const [page, anchor] = torManualPage.split("_", 2);
|
|
114 | + |
|
115 | + let locale = Services.locale.appLocaleAsBCP47;
|
|
116 | + if (locale === "ja-JP-macos") {
|
|
117 | + // Convert quirk-locale to the locale used for tor project.
|
|
118 | + locale = "ja";
|
|
119 | + }
|
|
120 | + |
|
121 | + let href = `https://tb-manual.torproject.org/${locale}/${page}/`;
|
|
122 | + if (anchor) {
|
|
123 | + href = `${href}#${anchor}`;
|
|
124 | + }
|
|
125 | + this.href = href;
|
|
126 | + return;
|
|
127 | + }
|
|
105 | 128 | let supportPage = this.getAttribute("support-page") ?? "";
|
106 | 129 | // Customize the link in about:preferences.
|
107 | 130 | // See mullvad-browser#244 and tor-browser#41910.
|
... | ... | @@ -128,21 +151,7 @@ customElements.define("moz-support-link", MozSupportLink, { extends: "a" }); |
128 | 151 | * Otherwise the url in unmodified form.
|
129 | 152 | */
|
130 | 153 | export function formatUTMParams(contentAttribute, url) {
|
131 | - if (!contentAttribute) {
|
|
132 | - return url;
|
|
133 | - }
|
|
134 | - let parsedUrl = new URL(url);
|
|
135 | - let domain = `.${parsedUrl.hostname}`;
|
|
136 | - if (
|
|
137 | - !domain.endsWith(".mozilla.org") &&
|
|
138 | - // For testing: addons-dev.allizom.org and addons.allizom.org
|
|
139 | - !domain.endsWith(".allizom.org")
|
|
140 | - ) {
|
|
141 | - return url;
|
|
142 | - }
|
|
143 | - |
|
144 | - parsedUrl.searchParams.set("utm_source", "firefox-browser");
|
|
145 | - parsedUrl.searchParams.set("utm_medium", "firefox-browser");
|
|
146 | - parsedUrl.searchParams.set("utm_content", contentAttribute);
|
|
147 | - return parsedUrl.href;
|
|
154 | + // Do not add utm parameters. See tor-browser#42583.
|
|
155 | + // NOTE: This method is also present in about:addons.
|
|
156 | + return url;
|
|
148 | 157 | } |