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

[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.9.0esr-13.0-1] fixup! Bug 21952: Implement Onion-Location



Title: GitLab

ma1 pushed to branch tor-browser-115.9.0esr-13.0-1 at The Tor Project / Applications / Tor Browser

Commits:

  • 4b69c259
    by hackademix at 2024-03-13T19:21:59+01:00
    fixup! Bug 21952: Implement Onion-Location
    
    Bug 42444: Remove the "Prioritize .onion sites when known" option
    

10 changed files:

Changes:

  • browser/components/onionservices/OnionLocationParent.jsm
    ... ... @@ -8,8 +8,10 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
    8 8
     const { TorStrings } = ChromeUtils.import("resource:///modules/TorStrings.jsm");
    
    9 9
     
    
    10 10
     // Prefs
    
    11
    +
    
    12
    +// We keep the "prioritizeonions" name, even if obsolete, in order to
    
    13
    +// prevent the notification from being shown again to upgrading users.
    
    11 14
     const NOTIFICATION_PREF = "privacy.prioritizeonions.showNotification";
    
    12
    -const PRIORITIZE_ONIONS_PREF = "privacy.prioritizeonions.enabled";
    
    13 15
     
    
    14 16
     // Element IDs
    
    15 17
     const _ONIONLOCATION_BOX_ID_ = "onion-location-box";
    
    ... ... @@ -23,9 +25,8 @@ const NOTIFICATION_ANCHOR_ID = "onion-location-box";
    23 25
     const STRING_ONION_AVAILABLE = TorStrings.onionLocation.onionAvailable;
    
    24 26
     const NOTIFICATION_CANCEL_LABEL = TorStrings.onionLocation.notNow;
    
    25 27
     const NOTIFICATION_CANCEL_ACCESSKEY = TorStrings.onionLocation.notNowAccessKey;
    
    26
    -const NOTIFICATION_OK_LABEL = TorStrings.onionLocation.alwaysPrioritize;
    
    27
    -const NOTIFICATION_OK_ACCESSKEY =
    
    28
    -  TorStrings.onionLocation.alwaysPrioritizeAccessKey;
    
    28
    +const NOTIFICATION_OK_LABEL = TorStrings.onionLocation.loadOnion;
    
    29
    +const NOTIFICATION_OK_ACCESSKEY = TorStrings.onionLocation.loadOnionAccessKey;
    
    29 30
     const NOTIFICATION_TITLE = TorStrings.onionLocation.tryThis;
    
    30 31
     const NOTIFICATION_DESCRIPTION = TorStrings.onionLocation.description;
    
    31 32
     const NOTIFICATION_LEARN_MORE_URL =
    
    ... ... @@ -95,9 +96,7 @@ class OnionLocationParent extends JSWindowActorParent {
    95 96
           label: NOTIFICATION_OK_LABEL,
    
    96 97
           accessKey: NOTIFICATION_OK_ACCESSKEY,
    
    97 98
           callback() {
    
    98
    -        Services.prefs.setBoolPref(PRIORITIZE_ONIONS_PREF, true);
    
    99 99
             OnionLocationParent.redirect(browser);
    
    100
    -        win.openPreferences("privacy-onionservices");
    
    101 100
           },
    
    102 101
         };
    
    103 102
     
    

  • browser/components/onionservices/content/onionlocationPreferences.inc.xhtml deleted
    1
    -# Copyright (c) 2020, The Tor Project, Inc.
    
    2
    -
    
    3
    -<groupbox id="onionServicesGroup" data-category="panePrivacy" data-subcategory="onionservices" hidden="true">
    
    4
    -  <label><html:h2 id="onionServicesTitle"></html:h2></label>
    
    5
    -  <label><label class="tail-with-learn-more" id="prioritizeOnionsDesc"></label><label
    
    6
    -  class="learnMore" is="text-link" id="onionServicesLearnMore"></label></label>
    
    7
    -  <radiogroup id="prioritizeOnionsRadioGroup" aria-labelledby="prioritizeOnionsDesc" preference="privacy.prioritizeonions.enabled">
    
    8
    -    <radio id="onionServicesRadioAlways" value="true"/>
    
    9
    -    <radio id="onionServicesRadioAsk" value="false"/>
    
    10
    -  </radiogroup>
    
    11
    -</groupbox>

  • browser/components/onionservices/content/onionlocationPreferences.js deleted
    1
    -// Copyright (c) 2020, The Tor Project, Inc.
    
    2
    -
    
    3
    -"use strict";
    
    4
    -
    
    5
    -ChromeUtils.defineModuleGetter(
    
    6
    -  this,
    
    7
    -  "TorStrings",
    
    8
    -  "resource:///modules/TorStrings.jsm"
    
    9
    -);
    
    10
    -
    
    11
    -const OnionLocationPreferences = {
    
    12
    -  init() {
    
    13
    -    document.getElementById("onionServicesTitle").textContent =
    
    14
    -      TorStrings.onionLocation.onionServicesTitle;
    
    15
    -    document.getElementById("prioritizeOnionsDesc").textContent =
    
    16
    -      TorStrings.onionLocation.prioritizeOnionsDescription;
    
    17
    -    const learnMore = document.getElementById("onionServicesLearnMore");
    
    18
    -    learnMore.textContent = TorStrings.onionLocation.learnMore;
    
    19
    -    learnMore.href = TorStrings.onionLocation.learnMoreURL;
    
    20
    -    if (TorStrings.onionLocation.learnMoreURL.startsWith("about:")) {
    
    21
    -      learnMore.setAttribute("useoriginprincipal", "true");
    
    22
    -    }
    
    23
    -    document.getElementById("onionServicesRadioAlways").label =
    
    24
    -      TorStrings.onionLocation.always;
    
    25
    -    document.getElementById("onionServicesRadioAsk").label =
    
    26
    -      TorStrings.onionLocation.askEverytime;
    
    27
    -  },
    
    28
    -};
    
    29
    -
    
    30
    -Object.defineProperty(this, "OnionLocationPreferences", {
    
    31
    -  value: OnionLocationPreferences,
    
    32
    -  enumerable: true,
    
    33
    -  writable: false,
    
    34
    -});

  • browser/components/onionservices/jar.mn
    ... ... @@ -6,5 +6,4 @@ browser.jar:
    6 6
         content/browser/onionservices/onionservices.css                (content/onionservices.css)
    
    7 7
         content/browser/onionservices/savedKeysDialog.js               (content/savedKeysDialog.js)
    
    8 8
         content/browser/onionservices/savedKeysDialog.xhtml            (content/savedKeysDialog.xhtml)
    
    9
    -    content/browser/onionservices/onionlocationPreferences.js      (content/onionlocationPreferences.js)
    
    10 9
         skin/classic/browser/onionlocation.css                         (content/onionlocation.css)

  • browser/components/preferences/privacy.inc.xhtml
    ... ... @@ -14,8 +14,6 @@
    14 14
       <html:h1 data-l10n-id="privacy-header"/>
    
    15 15
     </hbox>
    
    16 16
     
    
    17
    -#include ../onionservices/content/onionlocationPreferences.inc.xhtml
    
    18
    -
    
    19 17
     <!-- Tracking / Content Blocking -->
    
    20 18
     <groupbox id="trackingGroup" data-category="panePrivacy" hidden="true" aria-describedby="contentBlockingDescription" class="highlighting-group">
    
    21 19
       <label id="contentBlockingHeader"><html:h2 data-l10n-id="content-blocking-enhanced-tracking-protection"/></label>
    

  • browser/components/preferences/privacy.js
    ... ... @@ -75,12 +75,6 @@ XPCOMUtils.defineLazyScriptGetter(
    75 75
       "chrome://browser/content/securitylevel/securityLevel.js"
    
    76 76
     );
    
    77 77
     
    
    78
    -XPCOMUtils.defineLazyScriptGetter(
    
    79
    -  this,
    
    80
    -  ["OnionLocationPreferences"],
    
    81
    -  "chrome://browser/content/onionservices/onionlocationPreferences.js"
    
    82
    -);
    
    83
    -
    
    84 78
     XPCOMUtils.defineLazyPreferenceGetter(
    
    85 79
       this,
    
    86 80
       "OS_AUTH_ENABLED",
    
    ... ... @@ -167,9 +161,6 @@ Preferences.addAll([
    167 161
       // Do not track
    
    168 162
       { id: "privacy.donottrackheader.enabled", type: "bool" },
    
    169 163
     
    
    170
    -  // Onion Location
    
    171
    -  { id: "privacy.prioritizeonions.enabled", type: "bool" },
    
    172
    -
    
    173 164
       // Media
    
    174 165
       { id: "media.autoplay.default", type: "int" },
    
    175 166
     
    
    ... ... @@ -349,13 +340,6 @@ var gPrivacyPane = {
    349 340
         });
    
    350 341
       },
    
    351 342
     
    
    352
    -  /**
    
    353
    -   * Show the OnionLocation preferences UI
    
    354
    -   */
    
    355
    -  _initOnionLocation() {
    
    356
    -    OnionLocationPreferences.init();
    
    357
    -  },
    
    358
    -
    
    359 343
       /**
    
    360 344
        * Whether the prompt to restart Firefox should appear when changing the autostart pref.
    
    361 345
        */
    
    ... ... @@ -899,7 +883,6 @@ var gPrivacyPane = {
    899 883
         this._initTrackingProtectionExtensionControl();
    
    900 884
         OnionServicesAuthPreferences.init();
    
    901 885
         this._initSecurityLevel();
    
    902
    -    this._initOnionLocation();
    
    903 886
     
    
    904 887
         Services.telemetry.setEventRecordingEnabled("pwmgr", true);
    
    905 888
     
    

  • dom/base/Document.cpp
    ... ... @@ -6976,14 +6976,7 @@ void Document::SetHeaderData(nsAtom* aHeaderField, const nsAString& aData) {
    6976 6976
         nsCOMPtr<nsIURI> onionURI;
    
    6977 6977
         if (NS_SUCCEEDED(NS_NewURI(getter_AddRefs(onionURI), aData)) &&
    
    6978 6978
             IsValidOnionLocation(Document::GetDocumentURI(), onionURI)) {
    
    6979
    -      if (StaticPrefs::privacy_prioritizeonions_enabled()) {
    
    6980
    -        nsCOMPtr<nsIRefreshURI> refresher(mDocumentContainer);
    
    6981
    -        if (refresher) {
    
    6982
    -          refresher->RefreshURI(onionURI, NodePrincipal(), 0);
    
    6983
    -        }
    
    6984
    -      } else {
    
    6985
    -        mOnionLocationURI = onionURI;
    
    6986
    -      }
    
    6979
    +      mOnionLocationURI = onionURI;
    
    6987 6980
         }
    
    6988 6981
       }
    
    6989 6982
     }
    

  • mobile/android/geckoview/api.txt
    ... ... @@ -801,7 +801,6 @@ package org.mozilla.geckoview {
    801 801
         method public boolean getLoginAutofillEnabled();
    
    802 802
         method public boolean getPauseForDebuggerEnabled();
    
    803 803
         method public int getPreferredColorScheme();
    
    804
    -    method public boolean getPrioritizeOnions();
    
    805 804
         method public boolean getRemoteDebuggingEnabled();
    
    806 805
         method @Nullable public GeckoRuntime getRuntime();
    
    807 806
         method @Nullable public Rect getScreenSizeOverride();
    
    ... ... @@ -827,7 +826,6 @@ package org.mozilla.geckoview {
    827 826
         method public void setLocales(@Nullable String[]);
    
    828 827
         method @NonNull public GeckoRuntimeSettings setLoginAutofillEnabled(boolean);
    
    829 828
         method @NonNull public GeckoRuntimeSettings setPreferredColorScheme(int);
    
    830
    -    method @NonNull public GeckoRuntimeSettings setPrioritizeOnions(boolean);
    
    831 829
         method @NonNull public GeckoRuntimeSettings setRemoteDebuggingEnabled(boolean);
    
    832 830
         method @NonNull public GeckoRuntimeSettings setSpoofEnglish(boolean);
    
    833 831
         method @NonNull public GeckoRuntimeSettings setTorSecurityLevel(int);
    
    ... ... @@ -867,7 +865,6 @@ package org.mozilla.geckoview {
    867 865
         method @NonNull public GeckoRuntimeSettings.Builder locales(@Nullable String[]);
    
    868 866
         method @NonNull public GeckoRuntimeSettings.Builder loginAutofillEnabled(boolean);
    
    869 867
         method @NonNull public GeckoRuntimeSettings.Builder pauseForDebugger(boolean);
    
    870
    -    method @NonNull public GeckoRuntimeSettings.Builder prioritizeOnions(boolean);
    
    871 868
         method @NonNull public GeckoRuntimeSettings.Builder preferredColorScheme(int);
    
    872 869
         method @NonNull public GeckoRuntimeSettings.Builder remoteDebuggingEnabled(boolean);
    
    873 870
         method @NonNull public GeckoRuntimeSettings.Builder screenSizeOverride(int, int);
    

  • mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
    ... ... @@ -477,14 +477,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
    477 477
           return this;
    
    478 478
         }
    
    479 479
     
    
    480
    -    /**
    
    481
    -     * Sets whether the browser should prioritize .onion sites when available.
    
    482
    -     *
    
    483
    -     * @param flag  True if we should prioritize .onion sites, false otherwise
    
    484
    -     * @return This Builder instance.
    
    485
    -     */
    
    486
    -    public @NonNull Builder prioritizeOnions(final boolean flag) {
    
    487
    -      getSettings().mPrioritizeOnions.set(flag);
    
    488 480
           return this;
    
    489 481
         }
    
    490 482
       }
    
    ... ... @@ -538,8 +530,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
    538 530
       /* package */ final Pref<Integer> mSpoofEnglish = new Pref<>("privacy.spoof_english", 0);
    
    539 531
       /* package */ final Pref<Integer> mSecurityLevel =
    
    540 532
           new Pref<>("browser.security_level.security_slider", 4);
    
    541
    -  /* package */ final Pref<Boolean> mPrioritizeOnions =
    
    542
    -      new Pref<>("privacy.prioritizeonions.enabled", false);
    
    543 533
     
    
    544 534
       /* package */ int mPreferredColorScheme = COLOR_SCHEME_SYSTEM;
    
    545 535
     
    
    ... ... @@ -1332,23 +1322,6 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
    1332 1322
         return this;
    
    1333 1323
       }
    
    1334 1324
     
    
    1335
    -  /**
    
    1336
    -   * Gets whether we should prioritize .onion sites.
    
    1337
    -   *
    
    1338
    -   * @return Whether we should prioritize .onion sites.
    
    1339
    -   */
    
    1340
    -  public boolean getPrioritizeOnions() {
    
    1341
    -    return mPrioritizeOnions.get();
    
    1342
    -  }
    
    1343
    -
    
    1344
    -  /**
    
    1345
    -   * Sets whether we should prioritize .onion sites.
    
    1346
    -   *
    
    1347
    -   * @param flag Whether we should prioritize .onion sites.
    
    1348
    -   * @return This GeckoRuntimeSettings instance.
    
    1349
    -   */
    
    1350
    -  public @NonNull GeckoRuntimeSettings setPrioritizeOnions(final boolean flag) {
    
    1351
    -    mPrioritizeOnions.commit(flag);
    
    1352 1325
         return this;
    
    1353 1326
       }
    
    1354 1327
     
    

  • modules/libpref/init/StaticPrefList.yaml
    ... ... @@ -13578,11 +13578,6 @@
    13578 13578
       value: ""
    
    13579 13579
       mirror: never
    
    13580 13580
     
    
    13581
    -- name: privacy.prioritizeonions.enabled
    
    13582
    -  type: RelaxedAtomicBool
    
    13583
    -  value: false
    
    13584
    -  mirror: always
    
    13585
    -
    
    13586 13581
     #---------------------------------------------------------------------------
    
    13587 13582
     # Prefs starting with "prompts."
    
    13588 13583
     #---------------------------------------------------------------------------
    

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