[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.1.0esr-14.0-1] 5 commits: fixup! Bug 30237: Add v3 onion services client authentication prompt



Title: GitLab

Pier Angelo Vendrame pushed to branch tor-browser-128.1.0esr-14.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • ace2c34b
    by Henry Wilkes at 2024-08-20T12:55:05+00:00
    fixup! Bug 30237: Add v3 onion services client authentication prompt
    
    Bug 42212: Migrate onion service strings to Fluent.
    
    + Use "onion site" instead of "onionsite" or "onion service".
    + Use sentence case by default.
    + Changed the prompt accept button from "Done" to "OK", in line with
      other prompts.
    + Re-ordered the saved keys dialog introduction text from "Keys for the
      following onionsite are..." to "The following onion site keys are..."
    + Use bold text for the prompt title, rather than just the onion site
      part.
    + Clear the error message in the saved key dialog whenever the user
      tries to remove a key (again).
    + Other small tidies in the touched areas.
    
  • 611b5828
    by Henry Wilkes at 2024-08-20T12:55:05+00:00
    fixup! Bug 23247: Communicating security expectations for .onion
    
    Bug 42212: Migrate onion service strings to Fluent.
    
  • 0e22809c
    by Henry Wilkes at 2024-08-20T12:55:05+00:00
    fixup! Tor Browser strings
    
    Bug 42212: Migrate onion service strings to Fluent.
    
  • 35b2a147
    by Henry Wilkes at 2024-08-20T12:55:05+00:00
    fixup! Add TorStrings module for localization
    
    Bug 42212: Migrate onion service strings to Fluent.
    
  • 7143db9a
    by Henry Wilkes at 2024-08-20T12:55:05+00:00
    fixup! Tor Browser localization migration scripts.
    
    Bug 42212: Migrate onion service strings to Fluent.
    

16 changed files:

Changes:

  • browser/base/content/browser.xhtml
    ... ... @@ -6,11 +6,6 @@
    6 6
     # License, v. 2.0. If a copy of the MPL was not distributed with this
    
    7 7
     # file, You can obtain one at http://mozilla.org/MPL/2.0/.
    
    8 8
     
    
    9
    -<!DOCTYPE window [
    
    10
    -  <!ENTITY % torbuttonDTD SYSTEM "chrome://torbutton/locale/torbutton.dtd">
    
    11
    -%torbuttonDTD;
    
    12
    -]>
    
    13
    -
    
    14 9
     <html id="main-window"
    
    15 10
             xmlns:html="http://www.w3.org/1999/xhtml"
    
    16 11
             xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    

  • browser/base/content/pageinfo/pageInfo.xhtml
    ... ... @@ -27,6 +27,7 @@
    27 27
         <html:link rel="stylesheet" href="">"chrome://browser/skin/pageInfo.css" />
    
    28 28
     
    
    29 29
         <html:link rel="localization" href="">"browser/pageInfo.ftl"/>
    
    30
    +    <html:link rel="localization" href="">"toolkit/global/tor-browser.ftl"/>
    
    30 31
       </linkset>
    
    31 32
       #ifdef XP_MACOSX
    
    32 33
       #include ../macWindow.inc.xhtml
    

  • browser/base/content/pageinfo/security.js
    ... ... @@ -15,11 +15,6 @@ const { DownloadUtils } = ChromeUtils.importESModule(
    15 15
     ChromeUtils.defineESModuleGetters(this, {
    
    16 16
       LoginHelper: "resource://gre/modules/LoginHelper.sys.mjs",
    
    17 17
     });
    
    18
    -ChromeUtils.defineLazyGetter(this, "gTorButtonBundle", function () {
    
    19
    -  return Services.strings.createBundle(
    
    20
    -    "chrome://torbutton/locale/torbutton.properties"
    
    21
    -  );
    
    22
    -});
    
    23 18
     
    
    24 19
     var security = {
    
    25 20
       async init(uri, windowInfo) {
    
    ... ... @@ -364,9 +359,13 @@ async function securityOnLoad(uri, windowInfo) {
    364 359
           );
    
    365 360
         } else {
    
    366 361
           try {
    
    367
    -        hdr = gTorButtonBundle.formatStringFromName(
    
    368
    -          "pageInfo_OnionEncryptionWithBitsAndProtocol",
    
    369
    -          [info.encryptionAlgorithm, info.encryptionStrength + "", info.version]
    
    362
    +        hdr = await document.l10n.formatValue(
    
    363
    +          "page-info-onion-site-encryption-with-bits",
    
    364
    +          {
    
    365
    +            "encryption-type": info.encryptionAlgorithm,
    
    366
    +            "encryption-strength": info.encryptionStrength,
    
    367
    +            "encryption-version": info.version,
    
    368
    +          }
    
    370 369
             );
    
    371 370
           } catch (err) {
    
    372 371
             hdr =
    
    ... ... @@ -392,11 +391,9 @@ async function securityOnLoad(uri, windowInfo) {
    392 391
         }
    
    393 392
         msg2 = pkiBundle.getString("pageInfo_Privacy_None2");
    
    394 393
       } else {
    
    395
    -    try {
    
    396
    -      hdr = gTorButtonBundle.GetStringFromName("pageInfo_OnionEncryption");
    
    397
    -    } catch (err) {
    
    398
    -      hdr = "Connection Encrypted (Onion Service)";
    
    399
    -    }
    
    394
    +    hdr = await document.l10n.formatValue(
    
    395
    +      "page-info-onion-site-encryption-plain"
    
    396
    +    );
    
    400 397
     
    
    401 398
         msg1 = pkiBundle.getString("pageInfo_Privacy_Encrypted1");
    
    402 399
         msg2 = pkiBundle.getString("pageInfo_Privacy_Encrypted2");
    

  • browser/components/onionservices/content/authNotificationIcon.inc.xhtml
    ... ... @@ -3,4 +3,4 @@
    3 3
     <image id="tor-clientauth-notification-icon"
    
    4 4
            class="notification-anchor-icon tor-clientauth-icon"
    
    5 5
            role="button"
    
    6
    -       tooltiptext="&torbutton.onionServices.authPrompt.tooltip;"/>
    6
    +       data-l10n-id="onion-site-authentication-urlbar-button"/>

  • browser/components/onionservices/content/authPopup.inc.xhtml
    ... ... @@ -2,17 +2,25 @@
    2 2
     
    
    3 3
     <popupnotification id="tor-clientauth-notification" hidden="true">
    
    4 4
       <popupnotificationcontent orient="vertical">
    
    5
    -    <description id="tor-clientauth-notification-desc"/>
    
    6
    -    <label id="tor-clientauth-notification-learnmore"
    
    7
    -           class="text-link popup-notification-learnmore-link"
    
    8
    -           is="text-link"
    
    9
    -           href="">"about:manual#onion-services_onion-service-authentication"
    
    10
    -           useoriginprincipal="true"/>
    
    5
    +    <description id="tor-clientauth-notification-desc" />
    
    6
    +    <label
    
    7
    +      class="text-link popup-notification-learnmore-link"
    
    8
    +      is="text-link"
    
    9
    +      href="">"about:manual#onion-services_onion-service-authentication"
    
    10
    +      useoriginprincipal="true"
    
    11
    +      data-l10n-id="onion-site-authentication-prompt-learn-more"
    
    12
    +    />
    
    11 13
         <html:div>
    
    12
    -      <html:input id="tor-clientauth-notification-key" type="password"/>
    
    13
    -      <html:div id="tor-clientauth-warning"/>
    
    14
    -      <checkbox id="tor-clientauth-persistkey-checkbox"
    
    15
    -                label="&torbutton.onionServices.authPrompt.persistCheckboxLabel;"/>
    
    14
    +      <html:input
    
    15
    +        id="tor-clientauth-notification-key"
    
    16
    +        type="password"
    
    17
    +        data-l10n-id="onion-site-authentication-prompt-key-input"
    
    18
    +      />
    
    19
    +      <html:div id="tor-clientauth-warning"></html:div>
    
    20
    +      <checkbox
    
    21
    +        id="tor-clientauth-persistkey-checkbox"
    
    22
    +        data-l10n-id="onion-site-authentication-prompt-remember-checkbox"
    
    23
    +      />
    
    16 24
         </html:div>
    
    17 25
       </popupnotificationcontent>
    
    18 26
     </popupnotification>

  • browser/components/onionservices/content/authPreferences.inc.xhtml
    ... ... @@ -2,21 +2,34 @@
    2 2
     
    
    3 3
     <groupbox id="torOnionServiceKeys" orient="vertical"
    
    4 4
               data-category="panePrivacy" hidden="true">
    
    5
    -  <label><html:h2 id="torOnionServiceKeys-header"/></label>
    
    5
    +  <label><html:h2
    
    6
    +    data-l10n-id="onion-site-authentication-preferences-heading"
    
    7
    +  ></html:h2></label>
    
    6 8
       <hbox>
    
    7 9
         <description
    
    8 10
           class="description-deemphasized description-with-side-element"
    
    9 11
           flex="1"
    
    10 12
         >
    
    11
    -      <html:span id="torOnionServiceKeys-overview"
    
    12
    -                 class="tail-with-learn-more"/>
    
    13
    -      <label id="torOnionServiceKeys-learnMore" class="learnMore text-link"
    
    14
    -             is="text-link"/>
    
    13
    +      <html:span
    
    14
    +        id="torOnionServiceKeys-overview"
    
    15
    +        class="tail-with-learn-more"
    
    16
    +        data-l10n-id="onion-site-authentication-preferences-overview"
    
    17
    +      ></html:span>
    
    18
    +      <label
    
    19
    +        id="torOnionServiceKeys-learnMore"
    
    20
    +        class="learnMore text-link"
    
    21
    +        is="text-link"
    
    22
    +        href="">"about:manual#onion-services_onion-service-authentication"
    
    23
    +        useoriginprincipal="true"
    
    24
    +        data-l10n-id="onion-site-authentication-preferences-learn-more"
    
    25
    +      />
    
    15 26
         </description>
    
    16 27
         <vbox align="end">
    
    17
    -      <button id="torOnionServiceKeys-savedKeys"
    
    18
    -              is="highlightable-button"
    
    19
    -              class="accessory-button"/>
    
    28
    +      <html:button
    
    29
    +        id="torOnionServiceKeys-savedKeys"
    
    30
    +        class="accessory-button"
    
    31
    +        data-l10n-id="onion-site-authentication-preferences-saved-keys-button"
    
    32
    +      ></html:button>
    
    20 33
         </vbox>
    
    21 34
       </hbox>
    
    22 35
     </groupbox>

  • browser/components/onionservices/content/authPreferences.js
    ... ... @@ -2,69 +2,19 @@
    2 2
     
    
    3 3
     "use strict";
    
    4 4
     
    
    5
    -ChromeUtils.defineESModuleGetters(this, {
    
    6
    -  TorStrings: "resource://gre/modules/TorStrings.sys.mjs",
    
    7
    -});
    
    8
    -
    
    9
    -/* globals gSubDialog */
    
    10
    -
    
    11
    -/*
    
    12
    -  Onion Services Client Authentication Preferences Code
    
    13
    -
    
    14
    -  Code to handle init and update of onion services authentication section
    
    15
    -  in about:preferences#privacy
    
    16
    -*/
    
    17
    -
    
    18
    -const OnionServicesAuthPreferences = {
    
    19
    -  selector: {
    
    20
    -    groupBox: "#torOnionServiceKeys",
    
    21
    -    header: "#torOnionServiceKeys-header",
    
    22
    -    overview: "#torOnionServiceKeys-overview",
    
    23
    -    learnMore: "#torOnionServiceKeys-learnMore",
    
    24
    -    savedKeysButton: "#torOnionServiceKeys-savedKeys",
    
    25
    -  },
    
    5
    +/* import-globals-from /browser/components/preferences/preferences.js */
    
    26 6
     
    
    7
    +/**
    
    8
    + * Onion site preferences.
    
    9
    + */
    
    10
    +var OnionServicesAuthPreferences = {
    
    27 11
       init() {
    
    28
    -    // populate XUL with localized strings
    
    29
    -    this._populateXUL();
    
    30
    -  },
    
    31
    -
    
    32
    -  _populateXUL() {
    
    33
    -    const groupbox = document.querySelector(this.selector.groupBox);
    
    34
    -
    
    35
    -    let elem = groupbox.querySelector(this.selector.header);
    
    36
    -    elem.textContent = TorStrings.onionServices.authPreferences.header;
    
    37
    -
    
    38
    -    elem = groupbox.querySelector(this.selector.overview);
    
    39
    -    elem.textContent = TorStrings.onionServices.authPreferences.overview;
    
    40
    -
    
    41
    -    elem = groupbox.querySelector(this.selector.learnMore);
    
    42
    -    elem.setAttribute("value", TorStrings.onionServices.learnMore);
    
    43
    -    elem.setAttribute(
    
    44
    -      "href",
    
    45
    -      "about:manual#onion-services_onion-service-authentication"
    
    46
    -    );
    
    47
    -    elem.setAttribute("useoriginprincipal", "true");
    
    48
    -
    
    49
    -    elem = groupbox.querySelector(this.selector.savedKeysButton);
    
    50
    -    elem.setAttribute(
    
    51
    -      "label",
    
    52
    -      TorStrings.onionServices.authPreferences.savedKeys
    
    53
    -    );
    
    54
    -    elem.addEventListener("command", () =>
    
    55
    -      OnionServicesAuthPreferences.onViewSavedKeys()
    
    56
    -    );
    
    12
    +    document
    
    13
    +      .getElementById("torOnionServiceKeys-savedKeys")
    
    14
    +      .addEventListener("click", () => {
    
    15
    +        gSubDialog.open(
    
    16
    +          "chrome://browser/content/onionservices/savedKeysDialog.xhtml"
    
    17
    +        );
    
    18
    +      });
    
    57 19
       },
    
    58
    -
    
    59
    -  onViewSavedKeys() {
    
    60
    -    gSubDialog.open(
    
    61
    -      "chrome://browser/content/onionservices/savedKeysDialog.xhtml"
    
    62
    -    );
    
    63
    -  },
    
    64
    -}; // OnionServicesAuthPreferences
    
    65
    -
    
    66
    -Object.defineProperty(this, "OnionServicesAuthPreferences", {
    
    67
    -  value: OnionServicesAuthPreferences,
    
    68
    -  enumerable: true,
    
    69
    -  writable: false,
    
    70
    -});
    20
    +};

  • browser/components/onionservices/content/authPrompt.js
    ... ... @@ -56,28 +56,47 @@ var _OnionAuthPrompt_ = {
    56 56
       show(details) {
    
    57 57
         this._logger.debug(`New Notification: ${this._detailsRepr(details)}`);
    
    58 58
     
    
    59
    +    // NOTE: PopupNotifications currently requires the accesskey and label to be
    
    60
    +    // set for all actions, and does not accept fluent IDs in their place.
    
    61
    +    // Moreover, there doesn't appear to be a simple way to work around this, so
    
    62
    +    // we have to fetch the strings here before calling the show() method.
    
    63
    +    // NOTE: We avoid using the async formatMessages because we don't want to
    
    64
    +    // race against the browser's location changing.
    
    65
    +    // In principle, we could check that the details.browser.currentURI still
    
    66
    +    // matches details.uri or use a LocationChange listener. However, we expect
    
    67
    +    // that PopupNotifications will eventually change to accept fluent IDs, so
    
    68
    +    // we won't have to use formatMessages here at all.
    
    69
    +    // Moreover, we do not expect this notification to be common, so this
    
    70
    +    // shouldn't be too expensive.
    
    71
    +    // NOTE: Once we call PopupNotifications.show, PopupNotifications should
    
    72
    +    // take care of listening for changes in locations for us and remove the
    
    73
    +    // notification.
    
    74
    +    let [okButtonMsg, cancelButtonMsg] = this._lazy.SyncL10n.formatMessagesSync(
    
    75
    +      [
    
    76
    +        "onion-site-authentication-prompt-ok-button",
    
    77
    +        "onion-site-authentication-prompt-cancel-button",
    
    78
    +      ]
    
    79
    +    );
    
    80
    +
    
    81
    +    // Get an attribute string from a L10nMessage.
    
    82
    +    // We wrap the return value as a String to prevent the notification from
    
    83
    +    // throwing (and not showing) if a locale is unexpectedly missing a value.
    
    84
    +    const msgAttribute = (msg, name) =>
    
    85
    +      String((msg.attributes ?? []).find(attr => attr.name === name)?.value);
    
    86
    +
    
    59 87
         let mainAction = {
    
    60
    -      label: this.TorStrings.onionServices.authPrompt.done,
    
    61
    -      accessKey: this.TorStrings.onionServices.authPrompt.doneAccessKey,
    
    88
    +      label: msgAttribute(okButtonMsg, "label"),
    
    89
    +      accessKey: msgAttribute(okButtonMsg, "accesskey"),
    
    62 90
           leaveOpen: true, // Callback is responsible for closing the notification.
    
    63
    -      callback: this._onDone.bind(this),
    
    91
    +      callback: () => this._onDone(),
    
    64 92
         };
    
    65 93
     
    
    66
    -    let dialogBundle = Services.strings.createBundle(
    
    67
    -      "chrome://global/locale/dialog.properties"
    
    68
    -    );
    
    69
    -
    
    70
    -    let cancelAccessKey = dialogBundle.GetStringFromName("accesskey-cancel");
    
    71
    -    if (!cancelAccessKey) {
    
    72
    -      cancelAccessKey = "c";
    
    73
    -    } // required by PopupNotifications.show()
    
    74
    -
    
    75 94
         // The first secondarybuttoncommand (cancelAction) should be triggered when
    
    76 95
         // the user presses "Escape".
    
    77 96
         let cancelAction = {
    
    78
    -      label: dialogBundle.GetStringFromName("button-cancel"),
    
    79
    -      accessKey: cancelAccessKey,
    
    80
    -      callback: this._onCancel.bind(this),
    
    97
    +      label: msgAttribute(cancelButtonMsg, "label"),
    
    98
    +      accessKey: msgAttribute(cancelButtonMsg, "accesskey"),
    
    99
    +      callback: () => this._onCancel(),
    
    81 100
         };
    
    82 101
     
    
    83 102
         let options = {
    
    ... ... @@ -134,22 +153,17 @@ var _OnionAuthPrompt_ = {
    134 153
         this._keyInput.value = "";
    
    135 154
         this._persistCheckbox.checked = false;
    
    136 155
     
    
    137
    -    // Handle replacement of the onion name within the localized
    
    138
    -    // string ourselves so we can show the onion name as bold text.
    
    139
    -    // We do this by splitting the localized string and creating
    
    140
    -    // several HTML <span> elements.
    
    141
    -    const fmtString = this.TorStrings.onionServices.authPrompt.description;
    
    142
    -    const [prefix, suffix] = fmtString.split("%S");
    
    143
    -
    
    144
    -    const domainEl = document.createElement("span");
    
    145
    -    domainEl.id = "tor-clientauth-notification-onionname";
    
    146
    -    domainEl.textContent = TorUIUtils.shortenOnionAddress(
    
    147
    -      this._shownDetails?.onionHost ?? ""
    
    156
    +    document.l10n.setAttributes(
    
    157
    +      this._descriptionEl,
    
    158
    +      "onion-site-authentication-prompt-description",
    
    159
    +      {
    
    160
    +        onionsite: TorUIUtils.shortenOnionAddress(
    
    161
    +          this._shownDetails?.onionHost ?? ""
    
    162
    +        ),
    
    163
    +      }
    
    148 164
         );
    
    149 165
     
    
    150
    -    this._descriptionEl.replaceChildren(prefix, domainEl, suffix);
    
    151
    -
    
    152
    -    this._showWarning(undefined);
    
    166
    +    this._showWarning(null);
    
    153 167
       },
    
    154 168
     
    
    155 169
       /**
    
    ... ... @@ -187,12 +201,13 @@ var _OnionAuthPrompt_ = {
    187 201
         );
    
    188 202
     
    
    189 203
         // Grab the details before they might change as we await.
    
    190
    -    const { browser, onionServiceId, notification } = this._shownDetails;
    
    204
    +    const details = this._shownDetails;
    
    205
    +    const { browser, onionServiceId, notification } = details;
    
    191 206
         const isPermanent = this._persistCheckbox.checked;
    
    192 207
     
    
    193 208
         const base64key = this._keyToBase64(this._keyInput.value);
    
    194 209
         if (!base64key) {
    
    195
    -      this._showWarning(this.TorStrings.onionServices.authPrompt.invalidKey);
    
    210
    +      this._showWarning("onion-site-authentication-prompt-invalid-key");
    
    196 211
           return;
    
    197 212
         }
    
    198 213
     
    
    ... ... @@ -200,12 +215,11 @@ var _OnionAuthPrompt_ = {
    200 215
           const provider = await this._lazy.TorProviderBuilder.build();
    
    201 216
           await provider.onionAuthAdd(onionServiceId, base64key, isPermanent);
    
    202 217
         } catch (e) {
    
    203
    -      if (e.torMessage) {
    
    204
    -        this._showWarning(e.torMessage);
    
    205
    -      } else {
    
    206
    -        this._logger.error(`Failed to set key for ${onionServiceId}`, e);
    
    218
    +      this._logger.error(`Failed to set key for ${onionServiceId}`, e);
    
    219
    +      if (details === this._shownDetails) {
    
    220
    +        // Notification has not been replaced.
    
    207 221
             this._showWarning(
    
    208
    -          this.TorStrings.onionServices.authPrompt.failedToSetKey
    
    222
    +          "onion-site-authentication-prompt-setting-key-failed"
    
    209 223
             );
    
    210 224
           }
    
    211 225
           return;
    
    ... ... @@ -245,16 +259,19 @@ var _OnionAuthPrompt_ = {
    245 259
       /**
    
    246 260
        * Show a warning message to the user or clear the warning.
    
    247 261
        *
    
    248
    -   * @param {string?} warningMessage - The message to show, or undefined to
    
    249
    -   *   clear the current message.
    
    262
    +   * @param {?string} warningMessageId - The l10n ID for the message to show, or
    
    263
    +   *   null to clear the current message.
    
    250 264
        */
    
    251
    -  _showWarning(warningMessage) {
    
    252
    -    this._logger.debug(`Showing warning: ${warningMessage}`);
    
    253
    -    if (warningMessage) {
    
    254
    -      this._warningEl.textContent = warningMessage;
    
    265
    +  _showWarning(warningMessageId) {
    
    266
    +    this._logger.debug(`Showing warning: ${warningMessageId}`);
    
    267
    +    if (warningMessageId) {
    
    268
    +      document.l10n.setAttributes(this._warningEl, warningMessageId);
    
    255 269
           this._warningEl.removeAttribute("hidden");
    
    256 270
           this._keyInput.classList.add("invalid");
    
    257 271
         } else {
    
    272
    +      // Clean up.
    
    273
    +      this._warningEl.removeAttribute("data-l10n-id");
    
    274
    +      this._warningEl.textContent = "";
    
    258 275
           this._warningEl.setAttribute("hidden", "true");
    
    259 276
           this._keyInput.classList.remove("invalid");
    
    260 277
         }
    
    ... ... @@ -264,7 +281,7 @@ var _OnionAuthPrompt_ = {
    264 281
        * Convert the user-entered key into base64.
    
    265 282
        *
    
    266 283
        * @param {string} keyString - The key to convert.
    
    267
    -   * @returns {string?} - The base64 representation, or undefined if the given
    
    284
    +   * @returns {?string} - The base64 representation, or undefined if the given
    
    268 285
        *   key was not the correct format.
    
    269 286
        */
    
    270 287
       _keyToBase64(keyString) {
    
    ... ... @@ -310,14 +327,17 @@ var _OnionAuthPrompt_ = {
    310 327
           maxLogLevelPref: "browser.onionAuthPrompt.loglevel",
    
    311 328
         });
    
    312 329
     
    
    313
    -    const { TorStrings } = ChromeUtils.importESModule(
    
    314
    -      "resource://gre/modules/TorStrings.sys.mjs"
    
    315
    -    );
    
    316
    -    this.TorStrings = TorStrings;
    
    317 330
         ChromeUtils.defineESModuleGetters(this._lazy, {
    
    318 331
           TorProviderBuilder: "resource://gre/modules/TorProviderBuilder.sys.mjs",
    
    319 332
           CommonUtils: "resource://services-common/utils.sys.mjs",
    
    320 333
         });
    
    334
    +    // Allow synchornous access to the localized strings. Used only for the
    
    335
    +    // button actions, which is currently a hard requirement for
    
    336
    +    // PopupNotifications.show. Hopefully, PopupNotifications will accept fluent
    
    337
    +    // ids in their place, or get replaced with something else that does.
    
    338
    +    ChromeUtils.defineLazyGetter(this._lazy, "SyncL10n", () => {
    
    339
    +      return new Localization(["toolkit/global/tor-browser.ftl"], true);
    
    340
    +    });
    
    321 341
     
    
    322 342
         this._keyInput = document.getElementById("tor-clientauth-notification-key");
    
    323 343
         this._persistCheckbox = document.getElementById(
    
    ... ... @@ -328,19 +348,6 @@ var _OnionAuthPrompt_ = {
    328 348
           "tor-clientauth-notification-desc"
    
    329 349
         );
    
    330 350
     
    
    331
    -    // Set "Learn More" label and href.
    
    332
    -    const learnMoreElem = document.getElementById(
    
    333
    -      "tor-clientauth-notification-learnmore"
    
    334
    -    );
    
    335
    -    learnMoreElem.setAttribute(
    
    336
    -      "value",
    
    337
    -      this.TorStrings.onionServices.learnMore
    
    338
    -    );
    
    339
    -
    
    340
    -    this._keyInput.setAttribute(
    
    341
    -      "placeholder",
    
    342
    -      this.TorStrings.onionServices.authPrompt.keyPlaceholder
    
    343
    -    );
    
    344 351
         this._keyInput.addEventListener("keydown", event => {
    
    345 352
           if (event.key === "Enter") {
    
    346 353
             event.preventDefault();
    
    ... ... @@ -349,7 +356,7 @@ var _OnionAuthPrompt_ = {
    349 356
         });
    
    350 357
         this._keyInput.addEventListener("input", () => {
    
    351 358
           // Remove the warning.
    
    352
    -      this._showWarning(undefined);
    
    359
    +      this._showWarning(null);
    
    353 360
         });
    
    354 361
     
    
    355 362
         // Force back focus on click: tor-browser#41856
    

  • browser/components/onionservices/content/onionservices.css
    1 1
     /* Copyright (c) 2020, The Tor Project, Inc. */
    
    2 2
     
    
    3
    -@namespace html url("http://www.w3.org/1999/xhtml");
    
    4
    -
    
    5
    -html|*#tor-clientauth-notification-onionname {
    
    3
    +#tor-clientauth-notification-desc {
    
    6 4
       font-weight: bold;
    
    7 5
     }
    
    8 6
     
    
    9
    -html|*#tor-clientauth-notification-key {
    
    7
    +#tor-clientauth-notification-key {
    
    10 8
       box-sizing: border-box;
    
    11 9
       width: 100%;
    
    12 10
       margin-top: 15px;
    
    ... ... @@ -17,12 +15,12 @@ html|*#tor-clientauth-notification-key {
    17 15
      * browser/components/newtab/css/activity-stream-mac.css (linux and windows
    
    18 16
      * use the same rules).
    
    19 17
      */
    
    20
    -html|*#tor-clientauth-notification-key.invalid {
    
    18
    +#tor-clientauth-notification-key.invalid {
    
    21 19
       border: 1px solid #D70022;
    
    22 20
       box-shadow: 0 0 0 1px #D70022, 0 0 0 4px rgba(215, 0, 34, 0.3);
    
    23 21
     }
    
    24 22
     
    
    25
    -html|*#tor-clientauth-warning {
    
    23
    +#tor-clientauth-warning {
    
    26 24
       display: inline-block;
    
    27 25
       animation: fade-up-tt 450ms;
    
    28 26
       background: #D70022;
    
    ... ... @@ -35,11 +33,11 @@ html|*#tor-clientauth-warning {
    35 33
       z-index: 1;
    
    36 34
     }
    
    37 35
     
    
    38
    -html|*#tor-clientauth-warning[hidden] {
    
    36
    +#tor-clientauth-warning[hidden] {
    
    39 37
       display: none;
    
    40 38
     }
    
    41 39
     
    
    42
    -html|*#tor-clientauth-warning::before {
    
    40
    +#tor-clientauth-warning::before {
    
    43 41
       background: #D70022;
    
    44 42
       bottom: -8px;
    
    45 43
       content: '.';
    

  • browser/components/onionservices/content/savedKeysDialog.js
    ... ... @@ -3,23 +3,10 @@
    3 3
     "use strict";
    
    4 4
     
    
    5 5
     ChromeUtils.defineESModuleGetters(this, {
    
    6
    -  TorStrings: "resource://gre/modules/TorStrings.sys.mjs",
    
    7 6
       TorProviderBuilder: "resource://gre/modules/TorProviderBuilder.sys.mjs",
    
    8 7
     });
    
    9 8
     
    
    10 9
     var gOnionServicesSavedKeysDialog = {
    
    11
    -  selector: {
    
    12
    -    dialog: "#onionservices-savedkeys-dialog",
    
    13
    -    intro: "#onionservices-savedkeys-intro",
    
    14
    -    tree: "#onionservices-savedkeys-tree",
    
    15
    -    onionSiteCol: "#onionservices-savedkeys-siteCol",
    
    16
    -    onionKeyCol: "#onionservices-savedkeys-keyCol",
    
    17
    -    errorIcon: "#onionservices-savedkeys-errorIcon",
    
    18
    -    errorMessage: "#onionservices-savedkeys-errorMessage",
    
    19
    -    removeButton: "#onionservices-savedkeys-remove",
    
    20
    -    removeAllButton: "#onionservices-savedkeys-removeall",
    
    21
    -  },
    
    22
    -
    
    23 10
       _tree: undefined,
    
    24 11
       _busyCount: 0,
    
    25 12
       get _isBusy() {
    
    ... ... @@ -27,8 +14,8 @@ var gOnionServicesSavedKeysDialog = {
    27 14
         return this._busyCount > 0;
    
    28 15
       },
    
    29 16
     
    
    30
    -  // Public functions (called from outside this file).
    
    31
    -  async deleteSelectedKeys() {
    
    17
    +  async _deleteSelectedKeys() {
    
    18
    +    this._showError(null);
    
    32 19
         this._withBusy(async () => {
    
    33 20
           const indexesToDelete = [];
    
    34 21
           const count = this._tree.view.selection.getRangeCount();
    
    ... ... @@ -42,8 +29,6 @@ var gOnionServicesSavedKeysDialog = {
    42 29
           }
    
    43 30
     
    
    44 31
           if (indexesToDelete.length) {
    
    45
    -        const controllerFailureMsg =
    
    46
    -          TorStrings.onionServices.authPreferences.failedToRemoveKey;
    
    47 32
             const provider = await TorProviderBuilder.build();
    
    48 33
             try {
    
    49 34
               // Remove in reverse index order to avoid issues caused by index
    
    ... ... @@ -53,28 +38,23 @@ var gOnionServicesSavedKeysDialog = {
    53 38
               }
    
    54 39
             } catch (e) {
    
    55 40
               console.error("Removing a saved key failed", e);
    
    56
    -          if (e.torMessage) {
    
    57
    -            this._showError(e.torMessage);
    
    58
    -          } else {
    
    59
    -            this._showError(controllerFailureMsg);
    
    60
    -          }
    
    41
    +          this._showError(
    
    42
    +            "onion-site-saved-keys-dialog-remove-keys-error-message"
    
    43
    +          );
    
    61 44
             }
    
    62 45
           }
    
    63 46
         });
    
    64 47
       },
    
    65 48
     
    
    66
    -  async deleteAllKeys() {
    
    49
    +  async _deleteAllKeys() {
    
    67 50
         this._tree.view.selection.selectAll();
    
    68
    -    await this.deleteSelectedKeys();
    
    51
    +    await this._deleteSelectedKeys();
    
    69 52
       },
    
    70 53
     
    
    71
    -  updateButtonsState() {
    
    54
    +  _updateButtonsState() {
    
    72 55
         const haveSelection = this._tree.view.selection.getRangeCount() > 0;
    
    73
    -    const dialog = document.querySelector(this.selector.dialog);
    
    74
    -    const removeSelectedBtn = dialog.querySelector(this.selector.removeButton);
    
    75
    -    removeSelectedBtn.disabled = this._isBusy || !haveSelection;
    
    76
    -    const removeAllBtn = dialog.querySelector(this.selector.removeAllButton);
    
    77
    -    removeAllBtn.disabled = this._isBusy || this.rowCount === 0;
    
    56
    +    this._removeButton.disabled = this._isBusy || !haveSelection;
    
    57
    +    this._removeAllButton.disabled = this._isBusy || this.rowCount === 0;
    
    78 58
       },
    
    79 59
     
    
    80 60
       // Private functions.
    
    ... ... @@ -82,38 +62,40 @@ var gOnionServicesSavedKeysDialog = {
    82 62
         document.mozSubdialogReady = this._init();
    
    83 63
       },
    
    84 64
     
    
    85
    -  async _init() {
    
    65
    +  _init() {
    
    86 66
         this._populateXUL();
    
    87 67
         window.addEventListener("keypress", this._onWindowKeyPress.bind(this));
    
    88 68
         this._loadSavedKeys();
    
    89 69
       },
    
    90 70
     
    
    91 71
       _populateXUL() {
    
    92
    -    const dialog = document.querySelector(this.selector.dialog);
    
    93
    -    const authPrefStrings = TorStrings.onionServices.authPreferences;
    
    94
    -    dialog.setAttribute("title", authPrefStrings.dialogTitle);
    
    95
    -
    
    96
    -    let elem = dialog.querySelector(this.selector.intro);
    
    97
    -    elem.textContent = authPrefStrings.dialogIntro;
    
    98
    -
    
    99
    -    elem = dialog.querySelector(this.selector.onionSiteCol);
    
    100
    -    elem.setAttribute("label", authPrefStrings.onionSite);
    
    101
    -
    
    102
    -    elem = dialog.querySelector(this.selector.onionKeyCol);
    
    103
    -    elem.setAttribute("label", authPrefStrings.onionKey);
    
    104
    -
    
    105
    -    elem = dialog.querySelector(this.selector.removeButton);
    
    106
    -    elem.setAttribute("label", authPrefStrings.remove);
    
    107
    -
    
    108
    -    elem = dialog.querySelector(this.selector.removeAllButton);
    
    109
    -    elem.setAttribute("label", authPrefStrings.removeAll);
    
    72
    +    this._errorMessageContainer = document.getElementById(
    
    73
    +      "onionservices-savedkeys-errorContainer"
    
    74
    +    );
    
    75
    +    this._errorMessageEl = document.getElementById(
    
    76
    +      "onionservices-savedkeys-errorMessage"
    
    77
    +    );
    
    78
    +    this._removeButton = document.getElementById(
    
    79
    +      "onionservices-savedkeys-remove"
    
    80
    +    );
    
    81
    +    this._removeButton.addEventListener("click", () => {
    
    82
    +      this._deleteSelectedKeys();
    
    83
    +    });
    
    84
    +    this._removeAllButton = document.getElementById(
    
    85
    +      "onionservices-savedkeys-removeall"
    
    86
    +    );
    
    87
    +    this._removeButton.addEventListener("click", () => {
    
    88
    +      this._deleteAllKeys();
    
    89
    +    });
    
    110 90
     
    
    111
    -    this._tree = dialog.querySelector(this.selector.tree);
    
    91
    +    this._tree = document.getElementById("onionservices-savedkeys-tree");
    
    92
    +    this._tree.addEventListener("select", () => {
    
    93
    +      this._updateButtonsState();
    
    94
    +    });
    
    112 95
       },
    
    113 96
     
    
    114 97
       async _loadSavedKeys() {
    
    115
    -    const controllerFailureMsg =
    
    116
    -      TorStrings.onionServices.authPreferences.failedToGetKeys;
    
    98
    +    this._showError(null);
    
    117 99
         this._withBusy(async () => {
    
    118 100
           try {
    
    119 101
             this._tree.view = this;
    
    ... ... @@ -139,11 +121,10 @@ var gOnionServicesSavedKeysDialog = {
    139 121
             // Render the tree content.
    
    140 122
             this._tree.rowCountChanged(0, this.rowCount);
    
    141 123
           } catch (e) {
    
    142
    -        if (e.torMessage) {
    
    143
    -          this._showError(e.torMessage);
    
    144
    -        } else {
    
    145
    -          this._showError(controllerFailureMsg);
    
    146
    -        }
    
    124
    +        console.error("Failed to load keys", e);
    
    125
    +        this._showError(
    
    126
    +          "onion-site-saved-keys-dialog-fetch-keys-error-message"
    
    127
    +        );
    
    147 128
           }
    
    148 129
         });
    
    149 130
       },
    
    ... ... @@ -160,14 +141,14 @@ var gOnionServicesSavedKeysDialog = {
    160 141
       async _withBusy(func) {
    
    161 142
         this._busyCount++;
    
    162 143
         if (this._busyCount === 1) {
    
    163
    -      this.updateButtonsState();
    
    144
    +      this._updateButtonsState();
    
    164 145
         }
    
    165 146
         try {
    
    166 147
           await func();
    
    167 148
         } finally {
    
    168 149
           this._busyCount--;
    
    169 150
           if (this._busyCount === 0) {
    
    170
    -        this.updateButtonsState();
    
    151
    +        this._updateButtonsState();
    
    171 152
           }
    
    172 153
         }
    
    173 154
       },
    
    ... ... @@ -179,16 +160,25 @@ var gOnionServicesSavedKeysDialog = {
    179 160
         if (event.keyCode === KeyEvent.DOM_VK_ESCAPE) {
    
    180 161
           window.close();
    
    181 162
         } else if (event.keyCode === KeyEvent.DOM_VK_DELETE) {
    
    182
    -      this.deleteSelectedKeys();
    
    163
    +      this._deleteSelectedKeys();
    
    183 164
         }
    
    184 165
       },
    
    185 166
     
    
    186
    -  _showError(aMessage) {
    
    187
    -    document
    
    188
    -      .getElementById("onionservices-savedkeys-errorContainer")
    
    189
    -      .classList.toggle("show-error", !!aMessage);
    
    190
    -    const errorDesc = document.querySelector(this.selector.errorMessage);
    
    191
    -    errorDesc.textContent = aMessage ? aMessage : "";
    
    167
    +  /**
    
    168
    +   * Show an error, or clear it.
    
    169
    +   *
    
    170
    +   * @param {?string} messageId - The l10n ID of the message to show, or null to
    
    171
    +   *   clear it.
    
    172
    +   */
    
    173
    +  _showError(messageId) {
    
    174
    +    this._errorMessageContainer.classList.toggle("show-error", !!messageId);
    
    175
    +    if (messageId) {
    
    176
    +      document.l10n.setAttributes(this._errorMessageEl, messageId);
    
    177
    +    } else {
    
    178
    +      // Clean up.
    
    179
    +      this._errorMessageEl.removeAttribute("data-l10n-id");
    
    180
    +      this._errorMessageEl.textContent = "";
    
    181
    +    }
    
    192 182
       },
    
    193 183
     
    
    194 184
       // XUL tree widget view implementation.
    

  • browser/components/onionservices/content/savedKeysDialog.xhtml
    ... ... @@ -9,29 +9,37 @@
    9 9
       id="onionservices-savedkeys-dialog"
    
    10 10
       windowtype="OnionServices:SavedKeys"
    
    11 11
       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    
    12
    +  xmlns:html="http://www.w3.org/1999/xhtml"
    
    13
    +  data-l10n-id="onion-site-saved-keys-dialog-title"
    
    12 14
     >
    
    15
    +  <linkset>
    
    16
    +    <html:link rel="localization" href="">"toolkit/global/tor-browser.ftl" />
    
    17
    +  </linkset>
    
    18
    +
    
    13 19
       <script src="">"chrome://browser/content/onionservices/savedKeysDialog.js" />
    
    14 20
     
    
    15 21
       <vbox id="onionservices-savedkeys" class="contentPane" flex="1">
    
    16 22
         <label
    
    17 23
           id="onionservices-savedkeys-intro"
    
    18 24
           control="onionservices-savedkeys-tree"
    
    25
    +      data-l10n-id="onion-site-saved-keys-dialog-intro"
    
    19 26
         />
    
    20 27
         <separator class="thin" />
    
    21
    -    <tree
    
    22
    -      id="onionservices-savedkeys-tree"
    
    23
    -      flex="1"
    
    24
    -      hidecolumnpicker="true"
    
    25
    -      onselect="gOnionServicesSavedKeysDialog.updateButtonsState();"
    
    26
    -    >
    
    28
    +    <tree id="onionservices-savedkeys-tree" flex="1" hidecolumnpicker="true">
    
    27 29
           <treecols>
    
    28 30
             <treecol
    
    29 31
               id="onionservices-savedkeys-siteCol"
    
    30 32
               flex="1"
    
    31 33
               persist="width"
    
    34
    +          data-l10n-id="onion-site-saved-keys-dialog-table-header-site"
    
    32 35
             />
    
    33 36
             <splitter class="tree-splitter" />
    
    34
    -        <treecol id="onionservices-savedkeys-keyCol" flex="1" persist="width" />
    
    37
    +        <treecol
    
    38
    +          id="onionservices-savedkeys-keyCol"
    
    39
    +          flex="1"
    
    40
    +          persist="width"
    
    41
    +          data-l10n-id="onion-site-saved-keys-dialog-table-header-key"
    
    42
    +        />
    
    35 43
           </treecols>
    
    36 44
           <treechildren />
    
    37 45
         </tree>
    
    ... ... @@ -41,15 +49,15 @@
    41 49
         </hbox>
    
    42 50
         <separator class="thin" />
    
    43 51
         <hbox id="onionservices-savedkeys-buttons">
    
    44
    -      <button
    
    52
    +      <html:button
    
    45 53
             id="onionservices-savedkeys-remove"
    
    46 54
             disabled="true"
    
    47
    -        oncommand="gOnionServicesSavedKeysDialog.deleteSelectedKeys();"
    
    48
    -      />
    
    49
    -      <button
    
    55
    +        data-l10n-id="onion-site-saved-keys-dialog-remove-button"
    
    56
    +      ></html:button>
    
    57
    +      <html:button
    
    50 58
             id="onionservices-savedkeys-removeall"
    
    51
    -        oncommand="gOnionServicesSavedKeysDialog.deleteAllKeys();"
    
    52
    -      />
    
    59
    +        data-l10n-id="onion-site-saved-keys-dialog-remove-all-button"
    
    60
    +      ></html:button>
    
    53 61
         </hbox>
    
    54 62
       </vbox>
    
    55 63
     </window>

  • toolkit/locales/en-US/toolkit/global/tor-browser.ftl
    ... ... @@ -637,3 +637,62 @@ onion-neterror-invalid-address-description = The provided onion site address is
    637 637
     # "Circuit" refers to a Tor network circuit.
    
    638 638
     onion-neterror-timed-out-header = Onion site circuit creation timed out
    
    639 639
     onion-neterror-timed-out-description = Failed to connect to the onion site, possibly due to a poor network connection.
    
    640
    +
    
    641
    +## Onion site authentication prompt.
    
    642
    +## "Onion site" is an abbreviation of "onion website": a website whose domain URL ends in ".onion", which is reachable through the Tor network.
    
    643
    +
    
    644
    +# Here "open" is a verb.
    
    645
    +onion-site-authentication-urlbar-button =
    
    646
    +    .tooltiptext = Open the onion site authentication panel
    
    647
    +
    
    648
    +# $onionsite (String) - The shortened onion address for the current web site, for example "a3jx8k…pbsh7y.onion".
    
    649
    +onion-site-authentication-prompt-description = The onion site { $onionsite } is requesting that you authenticate.
    
    650
    +onion-site-authentication-prompt-learn-more = Learn more
    
    651
    +onion-site-authentication-prompt-key-input =
    
    652
    +    .placeholder = Enter your private key for this onion site
    
    653
    +onion-site-authentication-prompt-remember-checkbox =
    
    654
    +    .label = Remember this key
    
    655
    +onion-site-authentication-prompt-ok-button =
    
    656
    +    .label = OK
    
    657
    +    .accesskey = O
    
    658
    +onion-site-authentication-prompt-cancel-button =
    
    659
    +    .label = Cancel
    
    660
    +    .accesskey = C
    
    661
    +# Error message shown when the entered key is the wrong length or the wrong format.
    
    662
    +# "base32" and "base64" are technical names for binary-to-text encodings: https://en.wikipedia.org/wiki/Base64
    
    663
    +onion-site-authentication-prompt-invalid-key = Please enter a valid key (52 base32 characters or 44 base64 characters)
    
    664
    +onion-site-authentication-prompt-setting-key-failed = Unable to configure Tor with your key
    
    665
    +
    
    666
    +## Page Info window for onion sites.
    
    667
    +## "Onion site" is an abbreviation of "onion website": a website whose domain URL ends in ".onion", which is reachable through the Tor network.
    
    668
    +
    
    669
    +# $encryption-type (String) - The name of the encryption algorithm used for the page, for example "TLS_AES_128_GCM_SHA256".
    
    670
    +# $encryption-stength (Number) - The number of bits for the encryption key, for example "128" or "256". The "NUMBER" function will format this number to the same locale, and the "useGrouping" option will remove grouping symbols, like thousand separators. Note that the "bit" in "bit keys" refers to a computer "binary digit".
    
    671
    +# $encryption-version (String) - The name and version of the encryption, for example "TLS 1.3".
    
    672
    +page-info-onion-site-encryption-with-bits = Connection encrypted (Onion site, { $encryption-type }, { NUMBER($encryption-strength, useGrouping: "false") } bit keys, { $encryption-version })
    
    673
    +page-info-onion-site-encryption-plain = Connection encrypted (Onion site)
    
    674
    +
    
    675
    +## Onion site authentication preferences.
    
    676
    +## "Onion site" is an abbreviation of "onion website": a website whose domain URL ends in ".onion", which is reachable through the Tor network.
    
    677
    +
    
    678
    +onion-site-authentication-preferences-heading = Onion site authentication
    
    679
    +onion-site-authentication-preferences-overview = Some onion sites require that you identify yourself with a key (a kind of password) before you can access them.
    
    680
    +onion-site-authentication-preferences-learn-more = Learn more
    
    681
    +onion-site-authentication-preferences-saved-keys-button = Saved keys…
    
    682
    +
    
    683
    +## Onion site saved keys dialog.
    
    684
    +## "Onion site" is an abbreviation of "onion website": a website whose domain URL ends in ".onion", which is reachable through the Tor network.
    
    685
    +
    
    686
    +onion-site-saved-keys-dialog-title =
    
    687
    +    .title = Onion site keys
    
    688
    +
    
    689
    +onion-site-saved-keys-dialog-intro = The following onion site keys are stored on your computer.
    
    690
    +onion-site-saved-keys-dialog-table-header-site =
    
    691
    +    .label = Onion site
    
    692
    +# "Key" is a noun, for an access key.
    
    693
    +onion-site-saved-keys-dialog-table-header-key =
    
    694
    +    .label = Key
    
    695
    +onion-site-saved-keys-dialog-remove-button = Remove
    
    696
    +onion-site-saved-keys-dialog-remove-all-button = Remove all
    
    697
    +onion-site-saved-keys-dialog-fetch-keys-error-message = Unable to retrieve keys from Tor
    
    698
    +onion-site-saved-keys-dialog-remove-keys-error-message = Unable to remove key

  • toolkit/modules/TorStrings.sys.mjs
    ... ... @@ -221,71 +221,6 @@ const Loader = {
    221 221
         };
    
    222 222
       },
    
    223 223
     
    
    224
    -  /*
    
    225
    -    Tor Onion Services Strings, e.g., for the authentication prompt.
    
    226
    -  */
    
    227
    -  onionServices() {
    
    228
    -    const tsb = new TorPropertyStringBundle(
    
    229
    -      "chrome://torbutton/locale/torbutton.properties",
    
    230
    -      "onionServices."
    
    231
    -    );
    
    232
    -    const getString = tsb.getString.bind(tsb);
    
    233
    -
    
    234
    -    const retval = {
    
    235
    -      learnMore: getString("learnMore", "Learn more"),
    
    236
    -      authPrompt: {
    
    237
    -        description: getString(
    
    238
    -          "authPrompt.description2",
    
    239
    -          "%S is requesting that you authenticate."
    
    240
    -        ),
    
    241
    -        keyPlaceholder: getString(
    
    242
    -          "authPrompt.keyPlaceholder",
    
    243
    -          "Enter your key"
    
    244
    -        ),
    
    245
    -        done: getString("authPrompt.done", "Done"),
    
    246
    -        doneAccessKey: getString("authPrompt.doneAccessKey", "d"),
    
    247
    -        invalidKey: getString("authPrompt.invalidKey", "Invalid key"),
    
    248
    -        failedToSetKey: getString(
    
    249
    -          "authPrompt.failedToSetKey",
    
    250
    -          "Failed to set key"
    
    251
    -        ),
    
    252
    -      },
    
    253
    -      authPreferences: {
    
    254
    -        header: getString(
    
    255
    -          "authPreferences.header",
    
    256
    -          "Onion Services Authentication"
    
    257
    -        ),
    
    258
    -        overview: getString(
    
    259
    -          "authPreferences.overview",
    
    260
    -          "Some onion services require that you identify yourself with a key"
    
    261
    -        ),
    
    262
    -        savedKeys: getString("authPreferences.savedKeys", "Saved Keys"),
    
    263
    -        dialogTitle: getString(
    
    264
    -          "authPreferences.dialogTitle",
    
    265
    -          "Onion Services Keys"
    
    266
    -        ),
    
    267
    -        dialogIntro: getString(
    
    268
    -          "authPreferences.dialogIntro",
    
    269
    -          "Keys for the following onionsites are stored on your computer"
    
    270
    -        ),
    
    271
    -        onionSite: getString("authPreferences.onionSite", "Onionsite"),
    
    272
    -        onionKey: getString("authPreferences.onionKey", "Key"),
    
    273
    -        remove: getString("authPreferences.remove", "Remove"),
    
    274
    -        removeAll: getString("authPreferences.removeAll", "Remove All"),
    
    275
    -        failedToGetKeys: getString(
    
    276
    -          "authPreferences.failedToGetKeys",
    
    277
    -          "Failed to get keys"
    
    278
    -        ),
    
    279
    -        failedToRemoveKey: getString(
    
    280
    -          "authPreferences.failedToRemoveKey",
    
    281
    -          "Failed to remove key"
    
    282
    -        ),
    
    283
    -      },
    
    284
    -    };
    
    285
    -
    
    286
    -    return retval;
    
    287
    -  } /* Tor Onion Services Strings */,
    
    288
    -
    
    289 224
       /*
    
    290 225
         OnionLocation
    
    291 226
       */
    
    ... ... @@ -330,13 +265,6 @@ export const TorStrings = {
    330 265
         return this._torConnect;
    
    331 266
       },
    
    332 267
     
    
    333
    -  get onionServices() {
    
    334
    -    if (!this._onionServices) {
    
    335
    -      this._onionServices = Loader.onionServices();
    
    336
    -    }
    
    337
    -    return this._onionServices;
    
    338
    -  },
    
    339
    -
    
    340 268
       get onionLocation() {
    
    341 269
         if (!this._onionLocation) {
    
    342 270
           this._onionLocation = Loader.onionLocation();
    

  • toolkit/torbutton/chrome/locale/en-US/torbutton.dtd deleted
    1
    -<!-- Copyright (c) 2022, The Tor Project, Inc.
    
    2
    -   - This Source Code Form is subject to the terms of the Mozilla Public
    
    3
    -   - License, v. 2.0. If a copy of the MPL was not distributed with this
    
    4
    -   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
    
    5
    -
    
    6
    -<!-- Onion services strings. Strings are kept here for ease of translation. -->
    
    7
    -<!ENTITY torbutton.onionServices.authPrompt.tooltip "Open onion service client authentication prompt">
    
    8
    -<!ENTITY torbutton.onionServices.authPrompt.persistCheckboxLabel "Remember this key">

  • toolkit/torbutton/chrome/locale/en-US/torbutton.properties
    ... ... @@ -3,35 +3,6 @@
    3 3
     # License, v. 2.0. If a copy of the MPL was not distributed with this
    
    4 4
     # file, You can obtain one at http://mozilla.org/MPL/2.0/.
    
    5 5
     
    
    6
    -# .Onion Page Info prompt.
    
    7
    -pageInfo_OnionEncryptionWithBitsAndProtocol=Connection Encrypted (Onion Service, %1$S, %2$S bit keys, %3$S)
    
    8
    -pageInfo_OnionEncryption=Connection Encrypted (Onion Service)
    
    9
    -
    
    10
    -# Shared between Onion Auth prompt and preferences
    
    11
    -onionServices.learnMore=Learn more
    
    12
    -
    
    13
    -# Onion Services Authentication prompt
    
    14
    -# LOCALIZATION NOTE: %S will be replaced with the .onion address.
    
    15
    -onionServices.authPrompt.description2=%S is requesting that you authenticate.
    
    16
    -onionServices.authPrompt.keyPlaceholder=Enter your private key for this onion service
    
    17
    -onionServices.authPrompt.done=Done
    
    18
    -onionServices.authPrompt.doneAccessKey=d
    
    19
    -onionServices.authPrompt.invalidKey=Please enter a valid key (52 base32 characters or 44 base64 characters)
    
    20
    -onionServices.authPrompt.failedToSetKey=Unable to configure Tor with your key
    
    21
    -
    
    22
    -# Onion Services Authentication preferences
    
    23
    -onionServices.authPreferences.header=Onion Services Authentication
    
    24
    -onionServices.authPreferences.overview=Some onion services require that you identify yourself with a key (a kind of password) before you can access them.
    
    25
    -onionServices.authPreferences.savedKeys=Saved Keys…
    
    26
    -onionServices.authPreferences.dialogTitle=Onion Service Keys
    
    27
    -onionServices.authPreferences.dialogIntro=Keys for the following onionsites are stored on your computer
    
    28
    -onionServices.authPreferences.onionSite=Onionsite
    
    29
    -onionServices.authPreferences.onionKey=Key
    
    30
    -onionServices.authPreferences.remove=Remove
    
    31
    -onionServices.authPreferences.removeAll=Remove All
    
    32
    -onionServices.authPreferences.failedToGetKeys=Unable to retrieve keys from tor
    
    33
    -onionServices.authPreferences.failedToRemoveKey=Unable to remove key
    
    34
    -
    
    35 6
     # Profile/startup error messages.
    
    36 7
     # LOCALIZATION NOTE: %S is the application name.
    
    37 8
     profileProblemTitle=%S Profile Problem
    

  • tools/torbrowser/l10n/migrations/bug-42212-onion-services.py
    1
    +from fluent.migrate.helpers import transforms_from
    
    2
    +
    
    3
    +
    
    4
    +def migrate(ctx):
    
    5
    +    dtd_path = "torbutton.dtd"
    
    6
    +    properties_path = "torbutton.properties"
    
    7
    +
    
    8
    +    ctx.add_transforms(
    
    9
    +        "tor-browser.ftl",
    
    10
    +        "tor-browser.ftl",
    
    11
    +        transforms_from(
    
    12
    +            """
    
    13
    +onion-site-authentication-prompt-learn-more = { COPY(path, "onionServices.learnMore") }
    
    14
    +onion-site-authentication-prompt-remember-checkbox =
    
    15
    +    .label = { COPY(dtd_path, "torbutton.onionServices.authPrompt.persistCheckboxLabel") }
    
    16
    +onion-site-authentication-prompt-invalid-key = { COPY(path, "onionServices.authPrompt.invalidKey") }
    
    17
    +onion-site-authentication-prompt-setting-key-failed = { COPY(path, "onionServices.authPrompt.failedToSetKey") }
    
    18
    +onion-site-authentication-preferences-learn-more = { COPY(path, "onionServices.learnMore") }
    
    19
    +onion-site-saved-keys-dialog-table-header-key =
    
    20
    +    .label = { COPY(path, "onionServices.authPreferences.onionKey") }
    
    21
    +onion-site-saved-keys-dialog-remove-button = { COPY(path, "onionServices.authPreferences.remove") }
    
    22
    +onion-site-saved-keys-dialog-remove-keys-error-message = { COPY(path, "onionServices.authPreferences.failedToRemoveKey") }
    
    23
    +""",
    
    24
    +            dtd_path=dtd_path,
    
    25
    +            path=properties_path,
    
    26
    +        ),
    
    27
    +    )

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits