Commit 354ede1b authored by Kathleen Brade's avatar Kathleen Brade Committed by Matthew Finkel
Browse files

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.
parent 9086b2ed
...@@ -62,6 +62,7 @@ const PASSWORD_SYNC_NOTIFICATION_ID = "enable-password-sync"; ...@@ -62,6 +62,7 @@ const PASSWORD_SYNC_NOTIFICATION_ID = "enable-password-sync";
const HIDE_MOBILE_FOOTER_PREF = "signon.management.page.hideMobileFooter"; const HIDE_MOBILE_FOOTER_PREF = "signon.management.page.hideMobileFooter";
const SHOW_PASSWORD_SYNC_NOTIFICATION_PREF = const SHOW_PASSWORD_SYNC_NOTIFICATION_PREF =
"signon.management.page.showPasswordSyncNotification"; "signon.management.page.showPasswordSyncNotification";
const NOCERTDB_PREF = "security.nocertdb";
// about:logins will always use the privileged content process, // about:logins will always use the privileged content process,
// even if it is disabled for other consumers such as about:newtab. // even if it is disabled for other consumers such as about:newtab.
...@@ -431,6 +432,7 @@ class AboutLoginsParent extends JSWindowActorParent { ...@@ -431,6 +432,7 @@ class AboutLoginsParent extends JSWindowActorParent {
importVisible: importVisible:
Services.policies.isAllowed("profileImport") && Services.policies.isAllowed("profileImport") &&
AppConstants.platform != "linux", AppConstants.platform != "linux",
canCreateLogins: !Services.prefs.getBoolPref(NOCERTDB_PREF, false),
}); });
await AboutLogins._sendAllLoginRelatedObjects( await AboutLogins._sendAllLoginRelatedObjects(
......
...@@ -69,6 +69,11 @@ login-item { ...@@ -69,6 +69,11 @@ login-item {
grid-area: login; grid-area: login;
} }
/* Do not promote Mozilla Sync in Tor Browser. */
login-intro {
display: none !important;
}
#branding-logo { #branding-logo {
flex-basis: var(--sidebar-width); flex-basis: var(--sidebar-width);
flex-shrink: 0; flex-shrink: 0;
...@@ -83,7 +88,8 @@ login-item { ...@@ -83,7 +88,8 @@ login-item {
} }
} }
:root:not(.official-branding) #branding-logo { /* Hide "Firefox LockWise" branding in Tor Browser. */
#branding-logo {
visibility: hidden; visibility: hidden;
} }
......
...@@ -19,6 +19,9 @@ const gElements = { ...@@ -19,6 +19,9 @@ const gElements = {
get loginFooter() { get loginFooter() {
return this.loginItem.shadowRoot.querySelector("login-footer"); return this.loginItem.shadowRoot.querySelector("login-footer");
}, },
get createNewLoginButton() {
return this.loginList.shadowRoot.querySelector(".create-login-button");
},
}; };
let numberOfLogins = 0; let numberOfLogins = 0;
...@@ -100,6 +103,9 @@ window.addEventListener("AboutLoginsChromeToContent", event => { ...@@ -100,6 +103,9 @@ window.addEventListener("AboutLoginsChromeToContent", event => {
gElements.loginList.setSortDirection(event.detail.value.selectedSort); gElements.loginList.setSortDirection(event.detail.value.selectedSort);
document.documentElement.classList.add("initialized"); document.documentElement.classList.add("initialized");
gElements.loginList.classList.add("initialized"); gElements.loginList.classList.add("initialized");
if (!event.detail.value.canCreateLogins) {
gElements.createNewLoginButton.disabled = true;
}
break; break;
} }
case "ShowLoginItemError": { case "ShowLoginItemError": {
......
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
align-items: center; align-items: center;
} }
/* Do not promote Mozilla Sync in Tor Browser. */
.logged-out-view {
display: none !important;
}
.fxaccounts-extra-text { .fxaccounts-extra-text {
/* Only show at most 3 lines of text to limit the /* Only show at most 3 lines of text to limit the
text from overflowing the header. */ text from overflowing the header. */
......
...@@ -85,3 +85,13 @@ ...@@ -85,3 +85,13 @@
.menuitem-mobile-android { .menuitem-mobile-android {
background-image: url("chrome://browser/skin/logo-android.svg"); 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;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment