Commit 3f304949 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by clairehurst
Browse files

MB 21: Disable the password manager

This commit disables the about:login page and removes the "Login and
Password" section of about:preferences.

We do not do anything to the real password manager of Firefox, that is
in toolkit: it contains C++ parts that make it difficult to actually
prevent it from being built..

Finally, we modify the the function that opens about:login to report an
error in the console so that we can quickly get a backtrace to the code
that tries to use it.
parent 74a3cb29
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@
      <toolbarbutton id="appMenu-passwords-button"
                     class="subviewbutton"
                     data-l10n-id="appmenuitem-passwords"
                     hidden="true"
                     />
      <toolbarbutton id="appMenu-extensions-themes-button"
                     class="subviewbutton"
+1 −1
Original line number Diff line number Diff line
@@ -1271,7 +1271,7 @@ export class nsContextMenu {
      if (!this.isLoginForm()) {
        return;
      }
      showManage = true;
      showManage = Services.prefs.getBoolPref("signon.rememberSignons", true);

      // Disable the fill option if the user hasn't unlocked with their primary password
      // or if the password field or target field are disabled.
+2 −1
Original line number Diff line number Diff line
@@ -362,7 +362,8 @@
            </td>
          </tr>
          <!-- Passwords -->
          <tr>
          <!-- We remove the password manager in Mullvad Browser -->
          <tr hidden="true">
            <th>
              <xul:label control="security-privacy-passwords-value" data-l10n-id="security-view-privacy-passwords-value"/>
            </th>
+2 −1
Original line number Diff line number Diff line
@@ -1430,7 +1430,8 @@ BrowserGlue.prototype = {
    const BREACH_ALERTS_PREF = "signon.management.page.breach-alerts.enabled";
    const clearVulnerablePasswordsIfBreachAlertsDisabled = async function () {
      if (!Services.prefs.getBoolPref(BREACH_ALERTS_PREF)) {
        await lazy.LoginBreaches.clearAllPotentiallyVulnerablePasswords();
        // mullvad-browser#21: LoginBreaches is removed at compile time
        // await lazy.LoginBreaches.clearAllPotentiallyVulnerablePasswords();
      }
    };
    clearVulnerablePasswordsIfBreachAlertsDisabled();
+0 −32
Original line number Diff line number Diff line
@@ -84,38 +84,6 @@ let JSWINDOWACTORS = {
    enablePreference: "browser.contextual-password-manager.enabled",
  },

  AboutLogins: {
    parent: {
      esModuleURI: "resource:///actors/AboutLoginsParent.sys.mjs",
    },
    child: {
      esModuleURI: "resource:///actors/AboutLoginsChild.sys.mjs",
      events: {
        AboutLoginsCopyLoginDetail: { wantUntrusted: true },
        AboutLoginsCreateLogin: { wantUntrusted: true },
        AboutLoginsDeleteLogin: { wantUntrusted: true },
        AboutLoginsDismissBreachAlert: { wantUntrusted: true },
        AboutLoginsImportFromBrowser: { wantUntrusted: true },
        AboutLoginsImportFromFile: { wantUntrusted: true },
        AboutLoginsImportReportInit: { wantUntrusted: true },
        AboutLoginsImportReportReady: { wantUntrusted: true },
        AboutLoginsInit: { wantUntrusted: true },
        AboutLoginsGetHelp: { wantUntrusted: true },
        AboutLoginsOpenPreferences: { wantUntrusted: true },
        AboutLoginsOpenSite: { wantUntrusted: true },
        AboutLoginsRecordTelemetryEvent: { wantUntrusted: true },
        AboutLoginsRemoveAllLogins: { wantUntrusted: true },
        AboutLoginsSortChanged: { wantUntrusted: true },
        AboutLoginsSyncEnable: { wantUntrusted: true },
        AboutLoginsUpdateLogin: { wantUntrusted: true },
        AboutLoginsExportPasswords: { wantUntrusted: true },
      },
    },
    matches: ["about:logins", "about:logins?*", "about:loginsimportreport"],
    allFrames: true,
    remoteTypes: ["privilegedabout"],
  },

  AboutMessagePreview: {
    parent: {
      esModuleURI: "resource:///actors/AboutMessagePreviewParent.sys.mjs",
Loading