Commit 3ecbfe33 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

fixup! TB 30237: Add v3 onion services client authentication prompt

TB 44904: Use setting config for onion site settings.
parent a2d007fe
Loading
Loading
Loading
Loading
+0 −34
Original line number Diff line number Diff line
# Copyright (c) 2020, The Tor Project, Inc.

<groupbox id="torOnionServiceKeys" orient="vertical"
          data-category="panePrivacy" hidden="true">
  <label><html:h2
    data-l10n-id="onion-site-authentication-preferences-heading"
  ></html:h2></label>
  <hbox>
    <description
      class="description-deemphasized description-with-side-element"
      flex="1"
    >
      <html:span
        id="torOnionServiceKeys-overview"
        data-l10n-id="onion-site-authentication-preferences-overview"
      ></html:span>
      <label
        id="torOnionServiceKeys-learnMore"
        class="learnMore text-link"
        is="text-link"
        href="about:manual#onion-services_onion-service-authentication"
        useoriginprincipal="true"
        data-l10n-id="onion-site-authentication-preferences-learn-more"
      />
    </description>
    <vbox align="end">
      <html:button
        id="torOnionServiceKeys-savedKeys"
        class="accessory-button"
        data-l10n-id="onion-site-authentication-preferences-saved-keys-button"
      ></html:button>
    </vbox>
  </hbox>
</groupbox>
+0 −20
Original line number Diff line number Diff line
// Copyright (c) 2020, The Tor Project, Inc.

"use strict";

/* import-globals-from /browser/components/preferences/preferences.js */

/**
 * Onion site preferences.
 */
var OnionServicesAuthPreferences = {
  init() {
    document
      .getElementById("torOnionServiceKeys-savedKeys")
      .addEventListener("click", () => {
        gSubDialog.open(
          "chrome://browser/content/onionservices/savedKeysDialog.xhtml"
        );
      });
  },
};
+21 −0
Original line number Diff line number Diff line
@@ -650,6 +650,15 @@ Preferences.addSetting({
  pref: "signon.management.page.breach-alerts.enabled",
});

Preferences.addSetting({
  id: "onionSiteSavedKeys",
  onUserClick: () => {
    gSubDialog.open(
      "chrome://browser/content/onionservices/savedKeysDialog.xhtml"
    );
  },
});

SettingGroupManager.registerGroups({
  passwords: {
    inProgress: true,
@@ -759,6 +768,18 @@ SettingGroupManager.registerGroups({
      },
    ],
  },
  onionSiteAuthentication: {
    l10nId: "onion-site-authentication-group",
    headingLevel: 2,
    supportPage: "tor-manual:onion-services_onion-service-authentication",
    items: [
      {
        id: "onionSiteSavedKeys",
        control: "moz-box-button",
        l10nId: "onion-site-authentication-saved-keys-button",
      },
    ],
  },
  managePayments: {
    // Hide the payments settings. tor-browser#44460.
    hidden: true,
+1 −1
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@

<html:setting-group groupid="passwords" hidden="true" data-category="panePrivacy"  data-srd-migrated=""/>

#include ../onionservices/content/authPreferences.inc.xhtml
<html:setting-group groupid="onionSiteAuthentication" hidden="true" data-category="panePrivacy" />

<html:setting-group data-category="panePrivacy" data-subcategory="payment-methods-autofill credit-card-autofill" groupid="payments" data-group="formAutofill" hidden="true"  data-srd-migrated="" />
<html:setting-group data-category="panePrivacy" data-subcategory="addresses-autofill address-autofill" groupid="addresses" data-group="formAutofill" hidden="true"  data-srd-migrated="" />
+1 −7
Original line number Diff line number Diff line
@@ -60,12 +60,6 @@ ChromeUtils.defineLazyGetter(lazy, "gParentalControlsService", () =>
    : null
);

XPCOMUtils.defineLazyScriptGetter(
  this,
  ["OnionServicesAuthPreferences"],
  "chrome://browser/content/onionservices/authPreferences.js"
);

// TODO: module import via ChromeUtils.defineModuleGetter
XPCOMUtils.defineLazyScriptGetter(
  this,
@@ -644,6 +638,7 @@ var gPrivacyPane = {
    initSettingGroup("browsingProtection");
    initSettingGroup("cookiesAndSiteData");
    initSettingGroup("cookiesAndSiteData2");
    initSettingGroup("onionSiteAuthentication");
    initSettingGroup("certificates");
    initSettingGroup("ipprotection");
    // NOTE: "managePayments" and "manageAddresses" are usually initialised by
@@ -674,7 +669,6 @@ var gPrivacyPane = {
    this.networkCookieBehaviorReadPrefs();
    this._initTrackingProtectionExtensionControl();
    this._ensureTrackingProtectionExceptionListMigration();
    OnionServicesAuthPreferences.init();
    this._initSecurityLevel();

    Preferences.get("privacy.trackingprotection.enabled").on(