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

gitolite role git at cupani.torproject.org
Tue Nov 22 09:58:02 UTC 2022


This is an automated email from the git hooks/post-receive script.

richard pushed a commit to branch tor-browser-102.5.0esr-12.0-1
in repository tor-browser.

commit a880b01c43eed14d0733c3268e9c3963999081c3
Author: Kathy Brade <brade at pearlcrescent.com>
AuthorDate: 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              | 5 +++++
 browser/components/aboutlogins/content/aboutLogins.js               | 6 ++++++
 .../components/aboutlogins/content/components/fxaccounts-button.css | 5 +++++
 4 files changed, 18 insertions(+)

diff --git a/browser/components/aboutlogins/AboutLoginsParent.jsm b/browser/components/aboutlogins/AboutLoginsParent.jsm
index 7d605543ddd9..25102807c049 100644
--- a/browser/components/aboutlogins/AboutLoginsParent.jsm
+++ b/browser/components/aboutlogins/AboutLoginsParent.jsm
@@ -62,6 +62,7 @@ XPCOMUtils.defineLazyGetter(this, "AboutLoginsL10n", () => {
 const ABOUT_LOGINS_ORIGIN = "about:logins";
 const AUTH_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
 const PRIMARY_PASSWORD_NOTIFICATION_ID = "primary-password-login-required";
+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.
@@ -323,6 +324,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 dcbdfd493d37..72bd5be9e782 100644
--- a/browser/components/aboutlogins/content/aboutLogins.css
+++ b/browser/components/aboutlogins/content/aboutLogins.css
@@ -62,6 +62,11 @@ login-item[data-editing="true"] + login-intro,
   display: none;
 }
 
+/* Do not promote Mozilla Sync. */
+login-intro {
+  display: none !important;
+}
+
 .heading-wrapper {
   display: flex;
   justify-content: center;
diff --git a/browser/components/aboutlogins/content/aboutLogins.js b/browser/components/aboutlogins/content/aboutLogins.js
index 3e9374081dd6..72fd5a1c26a9 100644
--- a/browser/components/aboutlogins/content/aboutLogins.js
+++ b/browser/components/aboutlogins/content/aboutLogins.js
@@ -22,6 +22,9 @@ const gElements = {
       ".menuitem-remove-all-logins"
     );
   },
+  get createNewLoginButton() {
+    return this.loginList.shadowRoot.querySelector(".create-login-button");
+  },
 };
 
 let numberOfLogins = 0;
@@ -128,6 +131,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 3b134b14629e..82a57052e6fb 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. */
+.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. */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list