| ... |
... |
@@ -257,6 +257,7 @@ Preferences.addAll([ |
|
257
|
257
|
{ id: "signon.autofillForms", type: "bool" },
|
|
258
|
258
|
{ id: "signon.management.page.breach-alerts.enabled", type: "bool" },
|
|
259
|
259
|
{ id: "signon.firefoxRelay.feature", type: "string" },
|
|
|
260
|
+ { id: "security.nocertdb", type: "bool" },
|
|
260
|
261
|
]);
|
|
261
|
262
|
|
|
262
|
263
|
Preferences.addSetting({
|
| ... |
... |
@@ -522,15 +523,50 @@ Preferences.addSetting( |
|
522
|
523
|
}
|
|
523
|
524
|
);
|
|
524
|
525
|
|
|
|
526
|
+Preferences.addSetting({
|
|
|
527
|
+ id: "canSavePasswords",
|
|
|
528
|
+ pref: "security.nocertdb",
|
|
|
529
|
+ get: pref => {
|
|
|
530
|
+ return !pref;
|
|
|
531
|
+ },
|
|
|
532
|
+});
|
|
|
533
|
+
|
|
525
|
534
|
Preferences.addSetting({
|
|
526
|
535
|
id: "savePasswords",
|
|
527
|
536
|
pref: "signon.rememberSignons",
|
|
|
537
|
+ deps: ["canSavePasswords"],
|
|
|
538
|
+ visible: ({ canSavePasswords }, savePasswords) => {
|
|
|
539
|
+ // Only show this option if the user has explicitly disabled "nocertdb", or
|
|
|
540
|
+ // they have somehow switched this option on. tor-browser#45197.
|
|
|
541
|
+ return canSavePasswords.value || savePasswords.value;
|
|
|
542
|
+ },
|
|
528
|
543
|
controllingExtensionInfo: {
|
|
529
|
544
|
storeId: "services.passwordSavingEnabled",
|
|
530
|
545
|
l10nId: "extension-controlling-password-saving",
|
|
531
|
546
|
},
|
|
532
|
547
|
});
|
|
533
|
548
|
|
|
|
549
|
+Preferences.addSetting({
|
|
|
550
|
+ id: "showPasswordControls",
|
|
|
551
|
+ deps: ["canSavePasswords", "savePasswords"],
|
|
|
552
|
+ get: (_pref, { canSavePasswords, savePasswords }) => {
|
|
|
553
|
+ // Only show other password controls if the user has explicitly disabled
|
|
|
554
|
+ // "nocertdb", or they have somehow switched on save passwords.
|
|
|
555
|
+ // tor-browser#45197.
|
|
|
556
|
+ return canSavePasswords.value || savePasswords.value;
|
|
|
557
|
+ },
|
|
|
558
|
+});
|
|
|
559
|
+
|
|
|
560
|
+Preferences.addSetting({
|
|
|
561
|
+ id: "passwordsUnsupportedBanner",
|
|
|
562
|
+ deps: ["canSavePasswords"],
|
|
|
563
|
+ visible: ({ canSavePasswords }) => {
|
|
|
564
|
+ // NOTE: We show the banner even if disabling the password controls are
|
|
|
565
|
+ // visible because "savePasswords" is true.
|
|
|
566
|
+ return !canSavePasswords.value;
|
|
|
567
|
+ },
|
|
|
568
|
+});
|
|
|
569
|
+
|
|
534
|
570
|
Preferences.addSetting({
|
|
535
|
571
|
id: "managePasswordExceptions",
|
|
536
|
572
|
onUserClick: () => {
|
| ... |
... |
@@ -551,7 +587,10 @@ Preferences.addSetting({ |
|
551
|
587
|
|
|
552
|
588
|
Preferences.addSetting({
|
|
553
|
589
|
id: "requireOSAuthForPasswords",
|
|
554
|
|
- visible: () => lazy.OSKeyStore.canReauth(),
|
|
|
590
|
+ deps: ["showPasswordControls"],
|
|
|
591
|
+ visible: ({ showPasswordControls }) => {
|
|
|
592
|
+ return showPasswordControls.value && lazy.OSKeyStore.canReauth();
|
|
|
593
|
+ },
|
|
555
|
594
|
get: () => lazy.LoginHelper.getOSAuthEnabled(),
|
|
556
|
595
|
async set(checked) {
|
|
557
|
596
|
const [messageText, captionText] = await Promise.all([
|
| ... |
... |
@@ -585,10 +624,14 @@ Preferences.addSetting({ |
|
585
|
624
|
|
|
586
|
625
|
Preferences.addSetting({
|
|
587
|
626
|
id: "manageSavedPasswords",
|
|
|
627
|
+ deps: ["showPasswordControls"],
|
|
588
|
628
|
onUserClick: () => {
|
|
589
|
629
|
PasswordSettingHelpers.showPasswords();
|
|
590
|
630
|
},
|
|
591
|
|
- visible: () => {
|
|
|
631
|
+ visible: ({ showPasswordControls }) => {
|
|
|
632
|
+ if (!showPasswordControls.value) {
|
|
|
633
|
+ return false;
|
|
|
634
|
+ }
|
|
592
|
635
|
let policy = Services.policies.getActivePolicies();
|
|
593
|
636
|
return policy?.PasswordManagerEnabled !== false;
|
|
594
|
637
|
},
|
| ... |
... |
@@ -596,6 +639,10 @@ Preferences.addSetting({ |
|
596
|
639
|
|
|
597
|
640
|
Preferences.addSetting({
|
|
598
|
641
|
id: "additionalProtectionsGroup",
|
|
|
642
|
+ deps: ["showPasswordControls"],
|
|
|
643
|
+ visible: ({ showPasswordControls }) => {
|
|
|
644
|
+ return showPasswordControls.value;
|
|
|
645
|
+ },
|
|
599
|
646
|
});
|
|
600
|
647
|
|
|
601
|
648
|
Preferences.addSetting({
|
| ... |
... |
@@ -668,6 +715,10 @@ Preferences.addSetting({ |
|
668
|
715
|
Preferences.addSetting({
|
|
669
|
716
|
id: "breachAlerts",
|
|
670
|
717
|
pref: "signon.management.page.breach-alerts.enabled",
|
|
|
718
|
+ // Even for users who force passwords to be enabled, we hide this because
|
|
|
719
|
+ // login breach requires "fxmonitor-breaches" remote settings, which has no
|
|
|
720
|
+ // local JSON dumps in Base Browser. tor-browser#45197.
|
|
|
721
|
+ visible: () => false,
|
|
671
|
722
|
});
|
|
672
|
723
|
|
|
673
|
724
|
Preferences.addSetting({
|
| ... |
... |
@@ -687,6 +738,16 @@ SettingGroupManager.registerGroups({ |
|
687
|
738
|
l10nId: "forms-passwords-header",
|
|
688
|
739
|
headingLevel: 2,
|
|
689
|
740
|
items: [
|
|
|
741
|
+ // Add a banner to explain that passwords are unsupported.
|
|
|
742
|
+ // tor-browser#45197.
|
|
|
743
|
+ {
|
|
|
744
|
+ id: "passwordsUnsupportedBanner",
|
|
|
745
|
+ l10nId: "passwords-settings-unsupported-banner",
|
|
|
746
|
+ control: "moz-message-bar",
|
|
|
747
|
+ controlAttr: {
|
|
|
748
|
+ role: "status",
|
|
|
749
|
+ },
|
|
|
750
|
+ },
|
|
690
|
751
|
{
|
|
691
|
752
|
id: "savePasswords",
|
|
692
|
753
|
l10nId: "forms-ask-to-save-passwords",
|