[tor-commits] [tor-browser/tor-browser-78.6.1esr-10.0-1] Bug 33852: Clean up about:logins (LockWise) to avoid mentioning sync, etc.

sysrqb at torproject.org sysrqb at torproject.org
Fri Jan 8 15:35:26 UTC 2021


commit 4a6cab46ab49921f45b8f2a0f8164e0a5b6ba1d0
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Tue Jul 14 11:15:07 2020 -0400

    Bug 33852: Clean up about:logins (LockWise) to avoid mentioning sync, etc.
    
    Hide elements on about:logins that mention sync, "Firefox LockWise", and
    Mozilla's LockWise mobile apps.
    
    Disable the "Create New Login" button when security.nocertdb is true.
---
 browser/components/aboutlogins/AboutLoginsParent.jsm           |  2 ++
 browser/components/aboutlogins/content/aboutLogins.css         |  8 +++++++-
 browser/components/aboutlogins/content/aboutLogins.js          |  6 ++++++
 .../aboutlogins/content/components/fxaccounts-button.css       |  5 +++++
 .../components/aboutlogins/content/components/menu-button.css  | 10 ++++++++++
 5 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/browser/components/aboutlogins/AboutLoginsParent.jsm b/browser/components/aboutlogins/AboutLoginsParent.jsm
index a3b47f8f8527..5d0a0e4e83b9 100644
--- a/browser/components/aboutlogins/AboutLoginsParent.jsm
+++ b/browser/components/aboutlogins/AboutLoginsParent.jsm
@@ -62,6 +62,7 @@ const PASSWORD_SYNC_NOTIFICATION_ID = "enable-password-sync";
 const HIDE_MOBILE_FOOTER_PREF = "signon.management.page.hideMobileFooter";
 const SHOW_PASSWORD_SYNC_NOTIFICATION_PREF =
   "signon.management.page.showPasswordSyncNotification";
+const NOCERTDB_PREF = "security.nocertdb";
 
 // about:logins will always use the privileged content process,
 // even if it is disabled for other consumers such as about:newtab.
@@ -431,6 +432,7 @@ class AboutLoginsParent extends JSWindowActorParent {
             importVisible:
               Services.policies.isAllowed("profileImport") &&
               AppConstants.platform != "linux",
+            canCreateLogins: !Services.prefs.getBoolPref(NOCERTDB_PREF, false),
           });
 
           await AboutLogins._sendAllLoginRelatedObjects(
diff --git a/browser/components/aboutlogins/content/aboutLogins.css b/browser/components/aboutlogins/content/aboutLogins.css
index 7ed29bda8297..dca63da2e649 100644
--- a/browser/components/aboutlogins/content/aboutLogins.css
+++ b/browser/components/aboutlogins/content/aboutLogins.css
@@ -69,6 +69,11 @@ login-item {
   grid-area: login;
 }
 
+/* Do not promote Mozilla Sync in Tor Browser. */
+login-intro {
+  display: none !important;
+}
+
 #branding-logo {
   flex-basis: var(--sidebar-width);
   flex-shrink: 0;
@@ -83,7 +88,8 @@ login-item {
   }
 }
 
-:root:not(.official-branding) #branding-logo {
+/* Hide "Firefox LockWise" branding in Tor Browser. */
+#branding-logo {
   visibility: hidden;
 }
 
diff --git a/browser/components/aboutlogins/content/aboutLogins.js b/browser/components/aboutlogins/content/aboutLogins.js
index da7d9016a2eb..361b2b0d02bf 100644
--- a/browser/components/aboutlogins/content/aboutLogins.js
+++ b/browser/components/aboutlogins/content/aboutLogins.js
@@ -19,6 +19,9 @@ const gElements = {
   get loginFooter() {
     return this.loginItem.shadowRoot.querySelector("login-footer");
   },
+  get createNewLoginButton() {
+    return this.loginList.shadowRoot.querySelector(".create-login-button");
+  },
 };
 
 let numberOfLogins = 0;
@@ -100,6 +103,9 @@ window.addEventListener("AboutLoginsChromeToContent", event => {
       gElements.loginList.setSortDirection(event.detail.value.selectedSort);
       document.documentElement.classList.add("initialized");
       gElements.loginList.classList.add("initialized");
+      if (!event.detail.value.canCreateLogins) {
+        gElements.createNewLoginButton.disabled = true;
+      }
       break;
     }
     case "ShowLoginItemError": {
diff --git a/browser/components/aboutlogins/content/components/fxaccounts-button.css b/browser/components/aboutlogins/content/components/fxaccounts-button.css
index aefda548c84d..a02707980158 100644
--- a/browser/components/aboutlogins/content/components/fxaccounts-button.css
+++ b/browser/components/aboutlogins/content/components/fxaccounts-button.css
@@ -8,6 +8,11 @@
   align-items: center;
 }
 
+/* Do not promote Mozilla Sync in Tor Browser. */
+.logged-out-view {
+  display: none !important;
+}
+
 .fxaccounts-extra-text {
   /* Only show at most 3 lines of text to limit the
      text from overflowing the header. */
diff --git a/browser/components/aboutlogins/content/components/menu-button.css b/browser/components/aboutlogins/content/components/menu-button.css
index 3c93d409b2c7..2d7380b2ea37 100644
--- a/browser/components/aboutlogins/content/components/menu-button.css
+++ b/browser/components/aboutlogins/content/components/menu-button.css
@@ -85,3 +85,13 @@
 .menuitem-mobile-android {
   background-image: url("chrome://browser/skin/logo-android.svg");
 }
+
+/*
+ * Do not promote LockWise mobile apps in Tor Browser: hide the menu items
+ * and the separator line that precedes them.
+ */
+.menuitem-mobile-android,
+.menuitem-mobile-ios,
+button[data-event-name="AboutLoginsGetHelp"] + hr {
+  display: none !important;
+}





More information about the tor-commits mailing list