Commit 8e3c5b75 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
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 b275970b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@
                     class="subviewbutton"
                     data-l10n-id="appmenuitem-passwords"
                     oncommand="LoginHelper.openPasswordManager(window, { entryPoint: 'mainmenu' })"
                     hidden="true"
                     />
      <toolbarbutton id="appMenu-extensions-themes-button"
                     class="subviewbutton"
+1 −1
Original line number Diff line number Diff line
@@ -1136,7 +1136,7 @@ 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
@@ -375,7 +375,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 −34
Original line number Diff line number Diff line
@@ -357,39 +357,6 @@ let JSPROCESSACTORS = {
 * available at https://firefox-source-docs.mozilla.org/dom/ipc/jsactors.html
 */
let JSWINDOWACTORS = {
  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 },
        AboutLoginsSyncOptions: { 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",
@@ -3136,7 +3103,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();
        // privacy-browser#21: LoginBreaches is removed at compile time
        // await lazy.LoginBreaches.clearAllPotentiallyVulnerablePasswords();
      }
    };
    clearVulnerablePasswordsIfBreachAlertsDisabled();
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ static const RedirEntry kRedirMap[] = {
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::URI_CAN_LOAD_IN_CHILD |
         nsIAboutModule::HIDE_FROM_ABOUTABOUT},
#ifndef MULLVAD_BROWSER
    {"logins", "chrome://browser/content/aboutlogins/aboutLogins.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
@@ -70,6 +71,7 @@ static const RedirEntry kRedirMap[] = {
         nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
         nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
         nsIAboutModule::IS_SECURE_CHROME_UI},
#endif
    {"policies", "chrome://browser/content/policies/aboutPolicies.html",
     nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::IS_SECURE_CHROME_UI},
    {"privatebrowsing", "about:blank",
Loading