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

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.3.0esr-13.0-1] 2 commits: fixup! Bug 7494: Create local home page for TBB.



Title: GitLab

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

Commits:

  • 158d784f
    by Henry Wilkes at 2023-10-02T15:09:09+01:00
    fixup! Bug 7494: Create local home page for TBB.
    
    Bug 32328: Add info box to let users know when Tor Browser does not
    control the Tor Network connection configuration. And provide a link to
    check.torproject.org
    
  • 76c3008e
    by Henry Wilkes at 2023-10-03T17:05:40+01:00
    fixup! Tor Browser strings
    
    Bug 32328: Add info box to let users know when Tor Browser does not
    control the Tor Network connection configuration. And provide a link to
    check.torproject.org
    

5 changed files:

Changes:

  • browser/components/abouttor/AboutTorParent.sys.mjs
    ... ... @@ -4,6 +4,7 @@ const lazy = {};
    4 4
     
    
    5 5
     ChromeUtils.defineESModuleGetters(lazy, {
    
    6 6
       AboutTorMessage: "resource:///modules/AboutTorMessage.sys.mjs",
    
    7
    +  TorConnect: "resource:///modules/TorConnect.sys.mjs",
    
    7 8
     });
    
    8 9
     
    
    9 10
     export class AboutTorParent extends JSWindowActorParent {
    
    ... ... @@ -12,6 +13,7 @@ export class AboutTorParent extends JSWindowActorParent {
    12 13
         switch (message.name) {
    
    13 14
           case "AboutTor:GetInitialData":
    
    14 15
             return Promise.resolve({
    
    16
    +          torConnectEnabled: lazy.TorConnect.enabled,
    
    15 17
               messageData: lazy.AboutTorMessage.getNext(),
    
    16 18
               isStable: AppConstants.MOZ_UPDATE_CHANNEL === "release",
    
    17 19
               searchOnionize: Services.prefs.getBoolPref(onionizePref, false),
    

  • browser/components/abouttor/content/aboutTor.css
    ... ... @@ -4,10 +4,12 @@ body {
    4 4
       margin: 0;
    
    5 5
       min-height: 100vh;
    
    6 6
       display: grid;
    
    7
    +  --form-max-width: 600px;
    
    7 8
       grid-template:
    
    8 9
         /* Start space: unfilled. */
    
    9 10
         ". . ." 1fr
    
    10 11
         "heading heading heading" auto
    
    12
    +    "tor-check tor-check tor-check" auto
    
    11 13
         ". form ." min-content
    
    12 14
         "message message message" auto
    
    13 15
         /* End space: unfilled.
    
    ... ... @@ -16,8 +18,8 @@ body {
    16 18
          * not shrink to zero, but will instead shrink to a minimum size of
    
    17 19
          * 75px = (150px * 1fr / 2fr) */
    
    18 20
         ". . ." minmax(150px, 2fr)
    
    19
    -    /* NOTE: "form" will be given a maximum width of 600px. */
    
    20
    -    / 1fr minmax(max-content, 600px) 1fr;
    
    21
    +    /* NOTE: "form" will be given a maximum width of --form-max-width. */
    
    22
    +    / 1fr minmax(max-content, var(--form-max-width)) 1fr;
    
    21 23
       justify-items: center;
    
    22 24
       padding-inline: 20px;
    
    23 25
       background:
    
    ... ... @@ -44,6 +46,32 @@ h1 {
    44 46
       flex: 0 0 auto;
    
    45 47
     }
    
    46 48
     
    
    49
    +#tor-check {
    
    50
    +  grid-area: tor-check;
    
    51
    +  max-width: var(--form-max-width);
    
    52
    +  box-sizing: border-box;
    
    53
    +  display: flex;
    
    54
    +  gap: 10px;
    
    55
    +  align-items: center;
    
    56
    +  padding-inline: 24px;
    
    57
    +  padding-block: 12px;
    
    58
    +  border-radius: 8px;
    
    59
    +  margin-block-start: 0;
    
    60
    +  margin-block-end: 30px;
    
    61
    +}
    
    62
    +
    
    63
    +body:not(.show-tor-check) #tor-check {
    
    64
    +  display: none;
    
    65
    +}
    
    66
    +
    
    67
    +#tor-check-icon {
    
    68
    +  flex: 0 0 auto;
    
    69
    +  width: 16px;
    
    70
    +  height: 16px;
    
    71
    +  -moz-context-properties: fill;
    
    72
    +  fill: currentColor;
    
    73
    +}
    
    74
    +
    
    47 75
     .home-message:not(.shown-message) {
    
    48 76
       display: none;
    
    49 77
     }
    
    ... ... @@ -64,7 +92,10 @@ h1 {
    64 92
       margin-inline-end: 0.3em;
    
    65 93
     }
    
    66 94
     
    
    67
    -.home-message a {
    
    95
    +:is(
    
    96
    +  .home-message,
    
    97
    +  #tor-check,
    
    98
    +) a {
    
    68 99
       /* Increase gap between the link and the rest of the text. */
    
    69 100
       margin-inline: 0.4em;
    
    70 101
     }
    
    ... ... @@ -136,7 +167,11 @@ h1 {
    136 167
     
    
    137 168
     @media (prefers-contrast) {
    
    138 169
       #search-form {
    
    139
    -    border-color: -moz-DialogText;
    
    170
    +    border-color: var(--in-content-box-border-color);
    
    171
    +  }
    
    172
    +
    
    173
    +  #tor-check {
    
    174
    +    background-color: var(--in-content-box-info-background);
    
    140 175
       }
    
    141 176
     }
    
    142 177
     
    
    ... ... @@ -150,6 +185,10 @@ h1 {
    150 185
         --in-content-focus-outline: var(--focus-outline);
    
    151 186
       }
    
    152 187
     
    
    188
    +  #tor-check {
    
    189
    +    background-color: #1f0333;
    
    190
    +  }
    
    191
    +
    
    153 192
       body > :not(#search-form) {
    
    154 193
         /* Same as --in-content-page-color when "prefers-color-scheme: dark" */
    
    155 194
         --in-content-page-color: #fbfbfe;
    

  • browser/components/abouttor/content/aboutTor.html
    ... ... @@ -70,6 +70,20 @@
    70 70
           />
    
    71 71
           <span id="tor-browser-home-heading-text"></span>
    
    72 72
         </h1>
    
    73
    +    <p id="tor-check">
    
    74
    +      <img
    
    75
    +        id="tor-check-icon"
    
    76
    +        alt=""
    
    77
    +        src="">"chrome://global/skin/icons/info.svg"
    
    78
    +      />
    
    79
    +      <span data-l10n-id="tor-browser-home-tor-check-warning">
    
    80
    +        <a
    
    81
    +          data-l10n-name="tor-check-link"
    
    82
    +          href="">"https://check.torproject.org/"
    
    83
    +          target="_blank"
    
    84
    +        ></a>
    
    85
    +      </span>
    
    86
    +    </p>
    
    73 87
         <form id="search-form" method="get" rel="noreferrer">
    
    74 88
           <img
    
    75 89
             id="dax-logo"
    

  • browser/components/abouttor/content/aboutTor.js
    ... ... @@ -97,6 +97,7 @@ const MessageArea = {
    97 97
       _initialized: false,
    
    98 98
       _messageData: null,
    
    99 99
       _isStable: null,
    
    100
    +  _torConnectEnabled: null,
    
    100 101
     
    
    101 102
       /**
    
    102 103
        * Initialize the message area and heading once elements are available.
    
    ... ... @@ -112,10 +113,13 @@ const MessageArea = {
    112 113
        * @param {MessageData} messageData - The message data, indicating which
    
    113 114
        *   message to show.
    
    114 115
        * @param {boolean} isStable - Whether this is the stable release version.
    
    116
    +   * @param {boolean} torConnectEnabled - Whether TorConnect is enabled, and
    
    117
    +   *   therefore the Tor process was configured with about:torconnect.
    
    115 118
        */
    
    116
    -  setMessageData(messageData, isStable) {
    
    119
    +  setMessageData(messageData, isStable, torConnectEnabled) {
    
    117 120
         this._messageData = messageData;
    
    118 121
         this._isStable = isStable;
    
    122
    +    this._torConnectEnabled = torConnectEnabled;
    
    119 123
         this._update();
    
    120 124
       },
    
    121 125
     
    
    ... ... @@ -140,6 +144,8 @@ const MessageArea = {
    140 144
             : "tor-browser-home-heading-testing"
    
    141 145
         );
    
    142 146
     
    
    147
    +    document.body.classList.toggle("show-tor-check", !this._torConnectEnabled);
    
    148
    +
    
    143 149
         const { updateVersion, updateURL, number } = this._messageData;
    
    144 150
     
    
    145 151
         if (updateVersion) {
    
    ... ... @@ -170,9 +176,10 @@ window.addEventListener("DOMContentLoaded", () => {
    170 176
     });
    
    171 177
     
    
    172 178
     window.addEventListener("InitialData", event => {
    
    173
    -  const { isStable, searchOnionize, messageData } = event.detail;
    
    179
    +  const { torConnectEnabled, isStable, searchOnionize, messageData } =
    
    180
    +    event.detail;
    
    174 181
       SearchWidget.setOnionizeState(!!searchOnionize);
    
    175
    -  MessageArea.setMessageData(messageData, !!isStable);
    
    182
    +  MessageArea.setMessageData(messageData, !!isStable, !!torConnectEnabled);
    
    176 183
     });
    
    177 184
     
    
    178 185
     // YEC 2023 (year end campaign).
    

  • browser/locales/en-US/browser/tor-browser.ftl
    ... ... @@ -14,6 +14,11 @@ appmenu-open-tor-manual =
    14 14
     tor-browser-home-heading-stable = Explore. Privately.
    
    15 15
     tor-browser-home-heading-testing = Test. Thoroughly.
    
    16 16
     
    
    17
    +# Only shown when underlying Tor process was not started by Tor Browser.
    
    18
    +# "Tails" refers to the operating system, and should be translated as a brand name.
    
    19
    +# <a data-l10n-name="tor-check-link"> should contain the link text and close with </a>.
    
    20
    +tor-browser-home-tor-check-warning = Your connection to Tor is not being managed by Tor Browser. Some operating systems (like Tails) will manage this for you, or you could have set up a custom configuration. <a data-l10n-name="tor-check-link">Test your connection</a>
    
    21
    +
    
    17 22
     tor-browser-home-duck-duck-go-input =
    
    18 23
         .placeholder = Search with DuckDuckGo
    
    19 24
     # Toggle to switch from DuckDuckGo's plain ".com" domain to its ".onion" domain.
    

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