Commit 9920c722 authored by ma1's avatar ma1 Committed by Pier Angelo Vendrame
Browse files

fixup! Bug 21952: Implement Onion-Location

Bug 42440: Remove the "Prioritize .onion sites when known" option
parent 57af6feb
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -3,8 +3,10 @@
import { TorStrings } from "resource://gre/modules/TorStrings.sys.mjs";

// Prefs

// We keep the "prioritizeonions" name, even if obsolete, in order to
// prevent the notification from being shown again to upgrading users.
const NOTIFICATION_PREF = "privacy.prioritizeonions.showNotification";
const PRIORITIZE_ONIONS_PREF = "privacy.prioritizeonions.enabled";

// Element IDs
const ONIONLOCATION_BOX_ID = "onion-location-box";
@@ -18,9 +20,8 @@ const NOTIFICATION_ANCHOR_ID = "onion-location-box";
const STRING_ONION_AVAILABLE = TorStrings.onionLocation.onionAvailable;
const NOTIFICATION_CANCEL_LABEL = TorStrings.onionLocation.notNow;
const NOTIFICATION_CANCEL_ACCESSKEY = TorStrings.onionLocation.notNowAccessKey;
const NOTIFICATION_OK_LABEL = TorStrings.onionLocation.alwaysPrioritize;
const NOTIFICATION_OK_ACCESSKEY =
  TorStrings.onionLocation.alwaysPrioritizeAccessKey;
const NOTIFICATION_OK_LABEL = TorStrings.onionLocation.loadOnion;
const NOTIFICATION_OK_ACCESSKEY = TorStrings.onionLocation.loadOnionAccessKey;
const NOTIFICATION_TITLE = TorStrings.onionLocation.tryThis;
const NOTIFICATION_DESCRIPTION = TorStrings.onionLocation.description;
const NOTIFICATION_LEARN_MORE_URL =
@@ -90,9 +91,7 @@ export class OnionLocationParent extends JSWindowActorParent {
      label: NOTIFICATION_OK_LABEL,
      accessKey: NOTIFICATION_OK_ACCESSKEY,
      callback() {
        Services.prefs.setBoolPref(PRIORITIZE_ONIONS_PREF, true);
        OnionLocationParent.redirect(browser);
        win.openPreferences("privacy-onionservices");
      },
    };

+0 −11
Original line number Diff line number Diff line
# Copyright (c) 2020, The Tor Project, Inc.

<groupbox id="onionServicesGroup" data-category="panePrivacy" data-subcategory="onionservices" hidden="true">
  <label><html:h2 id="onionServicesTitle"></html:h2></label>
  <label><label class="tail-with-learn-more" id="prioritizeOnionsDesc"></label><label
  class="learnMore" is="text-link" id="onionServicesLearnMore"></label></label>
  <radiogroup id="prioritizeOnionsRadioGroup" aria-labelledby="prioritizeOnionsDesc" preference="privacy.prioritizeonions.enabled">
    <radio id="onionServicesRadioAlways" value="true"/>
    <radio id="onionServicesRadioAsk" value="false"/>
  </radiogroup>
</groupbox>
+0 −32
Original line number Diff line number Diff line
// Copyright (c) 2020, The Tor Project, Inc.

"use strict";

ChromeUtils.defineESModuleGetters(this, {
  TorStrings: "resource://gre/modules/TorStrings.sys.mjs",
});

const OnionLocationPreferences = {
  init() {
    document.getElementById("onionServicesTitle").textContent =
      TorStrings.onionLocation.onionServicesTitle;
    document.getElementById("prioritizeOnionsDesc").textContent =
      TorStrings.onionLocation.prioritizeOnionsDescription;
    const learnMore = document.getElementById("onionServicesLearnMore");
    learnMore.textContent = TorStrings.onionLocation.learnMore;
    learnMore.href = TorStrings.onionLocation.learnMoreURL;
    if (TorStrings.onionLocation.learnMoreURL.startsWith("about:")) {
      learnMore.setAttribute("useoriginprincipal", "true");
    }
    document.getElementById("onionServicesRadioAlways").label =
      TorStrings.onionLocation.always;
    document.getElementById("onionServicesRadioAsk").label =
      TorStrings.onionLocation.askEverytime;
  },
};

Object.defineProperty(this, "OnionLocationPreferences", {
  value: OnionLocationPreferences,
  enumerable: true,
  writable: false,
});
+0 −1
Original line number Diff line number Diff line
@@ -6,5 +6,4 @@ browser.jar:
    content/browser/onionservices/onionservices.css                (content/onionservices.css)
    content/browser/onionservices/savedKeysDialog.js               (content/savedKeysDialog.js)
    content/browser/onionservices/savedKeysDialog.xhtml            (content/savedKeysDialog.xhtml)
    content/browser/onionservices/onionlocationPreferences.js      (content/onionlocationPreferences.js)
    skin/classic/browser/onionlocation.css                         (content/onionlocation.css)
+0 −2
Original line number Diff line number Diff line
@@ -14,8 +14,6 @@
  <html:h1 data-l10n-id="privacy-header"/>
</hbox>

#include ../onionservices/content/onionlocationPreferences.inc.xhtml

<!-- Tracking / Content Blocking -->
<groupbox id="trackingGroup" data-category="panePrivacy" hidden="true" aria-describedby="contentBlockingDescription" class="highlighting-group">
  <label id="contentBlockingHeader"><html:h2 data-l10n-id="content-blocking-enhanced-tracking-protection"/></label>
Loading