[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/mullvad-browser][mullvad-browser-148.0a1-16.0-2] 4 commits: fixup! BB 41736: Customize toolbar for base-browser.



Title: GitLab

Pier Angelo Vendrame pushed to branch mullvad-browser-148.0a1-16.0-2 at The Tor Project / Applications / Mullvad Browser

Commits:

  • 01980dc9
    by Pier Angelo Vendrame at 2026-03-16T13:20:24+01:00
    fixup! BB 41736: Customize toolbar for base-browser.
    
    TB 44720: Move new identity to Tor Browser.
    
    Do not add the new identity button anymore on Base Browser.
    
  • 0ae04431
    by Pier Angelo Vendrame at 2026-03-16T13:20:25+01:00
    dropme! BB 40926: Implemented the New Identity feature
    
    MB 514: Revert "BB 40926: Implemented the New Identity feature"
    
    This reverts commit 4a56e172c6ebe04a4eee0c0f0f4d327386ba5150.
    
  • 431ed700
    by Pier Angelo Vendrame at 2026-03-16T13:20:25+01:00
    fixup! Firefox preference overrides.
    
    TB 44720: Move new identity to Tor Browser.
    
    Remove the Log levels section from 001-base-profile.js, since it is now
    empty.
    
  • 8839a280
    by Pier Angelo Vendrame at 2026-03-16T13:20:25+01:00
    fixup! MB 329: Customize toolbar for mullvad-browser.
    
    MB 514: Remove new identity from Mullvad Browser.
    

19 changed files:

Changes:

  • browser/app/profile/001-base-profile.js
    ... ... @@ -783,9 +783,6 @@ pref("privacy.globalprivacycontrol.pbmode.enabled", true);
    783 783
     // Disable platform text recognition functionality (tor-browser#42057)
    
    784 784
     pref("dom.text-recognition.enabled", false);
    
    785 785
     
    
    786
    -// Log levels
    
    787
    -pref("browser.new_identity.log_level", "Info");
    
    788
    -
    
    789 786
     #ifdef XP_WIN
    
    790 787
     pref("browser.taskbar.lists.enabled", false);
    
    791 788
     pref("browser.taskbar.lists.frequent.enabled", false);
    

  • browser/base/content/appmenu-viewcache.inc.xhtml
    ... ... @@ -63,12 +63,6 @@
    63 63
                          key="key_privatebrowsing"
    
    64 64
                          command="Tools:PrivateBrowsing"/>
    
    65 65
           <toolbarseparator/>
    
    66
    -      <toolbarbutton id="appMenu-new-identity"
    
    67
    -                     class="subviewbutton"
    
    68
    -                     data-l10n-id="appmenuitem-new-identity"
    
    69
    -                     key="new-identity-key"
    
    70
    -                     command="cmd_newIdentity"/>
    
    71
    -      <toolbarseparator/>
    
    72 66
           <toolbarbutton id="appMenu-bookmarks-button"
    
    73 67
                          class="subviewbutton subviewbutton-nav"
    
    74 68
                          data-l10n-id="library-bookmarks-menu"
    

  • browser/base/content/browser-menubar.inc
    ... ... @@ -26,12 +26,6 @@
    26 26
                     <menuitem id="menu_newPrivateWindow"
    
    27 27
                               command="Tools:PrivateBrowsing"
    
    28 28
                               key="key_privatebrowsing" data-l10n-id="menu-file-new-private-window"/>
    
    29
    -                <menuseparator/>
    
    30
    -                <menuitem id="menu_newIdentity"
    
    31
    -                          command="cmd_newIdentity"
    
    32
    -                          key="new-identity-key"
    
    33
    -                          data-l10n-id="menu-new-identity"/>
    
    34
    -                <menuseparator/>
    
    35 29
                     <menuitem id="menu_openLocation"
    
    36 30
                               hidden="true"
    
    37 31
                               command="Browser:OpenLocation"
    

  • browser/base/content/browser-sets.inc
    ... ... @@ -116,8 +116,6 @@
    116 116
     #ifdef XP_MACOSX
    
    117 117
         <command id="zoomWindow" data-l10n-id="window-zoom-command" />
    
    118 118
     #endif
    
    119
    -
    
    120
    -    <command id="cmd_newIdentity" />
    
    121 119
       </commandset>
    
    122 120
     #include ../../components/places/content/placesCommands.inc.xhtml
    
    123 121
       <commandset id="splitViewCommands">
    
    ... ... @@ -415,5 +413,4 @@
    415 413
              modifiers="accel,alt"
    
    416 414
              internal="true"/>
    
    417 415
     #endif
    
    418
    -    <key id="new-identity-key" modifiers="accel shift" key="U" command="cmd_newIdentity"/>
    
    419 416
       </keyset>

  • browser/base/content/browser-sets.js
    ... ... @@ -267,9 +267,6 @@ document.addEventListener(
    267 267
               case "zoomWindow":
    
    268 268
                 zoomWindow();
    
    269 269
                 break;
    
    270
    -          case "cmd_newIdentity":
    
    271
    -            NewIdentityButton.onCommand(event);
    
    272
    -            break;
    
    273 270
             }
    
    274 271
           });
    
    275 272
     
    

  • browser/base/content/browser.js
    ... ... @@ -271,11 +271,6 @@ XPCOMUtils.defineLazyScriptGetter(
    271 271
       ["SecurityLevelButton"],
    
    272 272
       "chrome://browser/content/securitylevel/securityLevel.js"
    
    273 273
     );
    
    274
    -XPCOMUtils.defineLazyScriptGetter(
    
    275
    -  this,
    
    276
    -  ["NewIdentityButton"],
    
    277
    -  "chrome://browser/content/newidentity.js"
    
    278
    -);
    
    279 274
     XPCOMUtils.defineLazyScriptGetter(
    
    280 275
       this,
    
    281 276
       "gEditItemOverlay",
    

  • browser/base/content/browser.js.globals
    ... ... @@ -239,6 +239,5 @@
    239 239
       "ToolbarDropHandler",
    
    240 240
       "ProfilesDatastoreService",
    
    241 241
       "gTrustPanelHandler",
    
    242
    -  "SecurityLevelButton",
    
    243
    -  "NewIdentityButton"
    
    242
    +  "SecurityLevelButton"
    
    244 243
     ]

  • browser/base/content/navigator-toolbox.inc.xhtml
    ... ... @@ -578,11 +578,6 @@
    578 578
                        command="cmd_newNavigator"
    
    579 579
                        tooltip="dynamic-shortcut-tooltip"/>
    
    580 580
     
    
    581
    -    <toolbarbutton id="new-identity-button"
    
    582
    -                   command="cmd_newIdentity"
    
    583
    -                   class="toolbarbutton-1 chromeclass-toolbar-additional"
    
    584
    -                   data-l10n-id="toolbar-new-identity"/>
    
    585
    -
    
    586 581
         <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
    
    587 582
                        observes="View:FullScreen"
    
    588 583
                        command="View:FullScreen"
    

  • browser/components/customizableui/CustomizableUI.sys.mjs
    ... ... @@ -79,7 +79,7 @@ const NoScriptId = "_73a6fe31-595d-460b-a920-fcc0f8843232_-browser-action";
    79 79
     /**
    
    80 80
      * The current version for mullvad browser.
    
    81 81
      */
    
    82
    -var kVersionMullvadBrowser = 1;
    
    82
    +var kVersionMullvadBrowser = 2;
    
    83 83
     
    
    84 84
     /**
    
    85 85
      * Buttons removed from built-ins by version they were removed. kVersion must be
    
    ... ... @@ -363,7 +363,6 @@ var CustomizableUIInternal = {
    363 363
           // _updateForMullvadBrowser.
    
    364 364
           // Do not show the security-level-button by default in Mullvad Browser.
    
    365 365
           // See mullvad-browser#329
    
    366
    -      "new-identity-button",
    
    367 366
           "downloads-button",
    
    368 367
           AppConstants.MOZ_DEV_EDITION ? "developer-button" : null,
    
    369 368
           "fxa-toolbar-menu-button",
    
    ... ... @@ -1004,8 +1003,8 @@ var CustomizableUIInternal = {
    1004 1003
               navbarPlacements.splice(before, 1);
    
    1005 1004
             }
    
    1006 1005
     
    
    1007
    -        // Make sure the security-level-button and new-identity-button appears
    
    1008
    -        // in the toolbar.
    
    1006
    +        // Make sure security-level-button and new-identity-button appear in the
    
    1007
    +        // toolbar.
    
    1009 1008
             for (const id of ["new-identity-button", "security-level-button"]) {
    
    1010 1009
               let alreadyAdded = false;
    
    1011 1010
               for (const placements of Object.values(gSavedState.placements)) {
    
    ... ... @@ -1127,6 +1126,17 @@ var CustomizableUIInternal = {
    1127 1126
             }
    
    1128 1127
           }
    
    1129 1128
         }
    
    1129
    +
    
    1130
    +    if (currentVersion < 2) {
    
    1131
    +      // mullvad-browser#514: Clean up the new-identity-button placement, which
    
    1132
    +      // no longer exists.
    
    1133
    +      for (const placements of Object.values(gSavedState.placements)) {
    
    1134
    +        const buttonIndex = placements.indexOf("new-identity-button");
    
    1135
    +        if (buttonIndex !== -1) {
    
    1136
    +          placements.splice(buttonIndex, 1);
    
    1137
    +        }
    
    1138
    +      }
    
    1139
    +    }
    
    1130 1140
       },
    
    1131 1141
     
    
    1132 1142
       /**
    

  • browser/components/customizableui/CustomizeMode.sys.mjs
    ... ... @@ -252,7 +252,6 @@ export class CustomizeMode {
    252 252
         "Browser:NewUserContextTab",
    
    253 253
         "Tools:PrivateBrowsing",
    
    254 254
         "zoomWindow",
    
    255
    -    "cmd_newIdentity",
    
    256 255
       ]);
    
    257 256
     
    
    258 257
       /**
    

  • browser/components/moz.build
    ... ... @@ -47,7 +47,6 @@ DIRS += [
    47 47
         "mozcachedohttp",
    
    48 48
         "mullvad-browser",
    
    49 49
         "multilineeditor",
    
    50
    -    "newidentity",
    
    51 50
         # Exclude newtab component. tor-browser#43886.
    
    52 51
         "originattributes",
    
    53 52
         "pagedata",
    

  • browser/components/newidentity/content/newidentity.js deleted
    1
    -"use strict";
    
    2
    -
    
    3
    -// Use a lazy getter because NewIdentityButton is declared more than once
    
    4
    -// otherwise.
    
    5
    -ChromeUtils.defineLazyGetter(this, "NewIdentityButton", () => {
    
    6
    -  // Logger adapted from CustomizableUI.jsm
    
    7
    -  const logger = (() => {
    
    8
    -    const consoleOptions = {
    
    9
    -      maxLogLevelPref: "browser.new_identity.log_level",
    
    10
    -      prefix: "NewIdentity",
    
    11
    -    };
    
    12
    -    return console.createInstance(consoleOptions);
    
    13
    -  })();
    
    14
    -
    
    15
    -  const topics = Object.freeze({
    
    16
    -    newIdentityRequested: "new-identity-requested",
    
    17
    -  });
    
    18
    -
    
    19
    -  /**
    
    20
    -   * This class contains the actual implementation of the various step involved
    
    21
    -   * when running new identity.
    
    22
    -   */
    
    23
    -  class NewIdentityImpl {
    
    24
    -    async run() {
    
    25
    -      this.disableAllJS();
    
    26
    -      await this.clearState();
    
    27
    -      await this.openNewWindow();
    
    28
    -      this.closeOldWindow();
    
    29
    -      this.broadcast();
    
    30
    -    }
    
    31
    -
    
    32
    -    // Disable JS (as a defense-in-depth measure)
    
    33
    -
    
    34
    -    disableAllJS() {
    
    35
    -      logger.info("Disabling _javascript_");
    
    36
    -      const enumerator = Services.wm.getEnumerator("navigator:browser");
    
    37
    -      while (enumerator.hasMoreElements()) {
    
    38
    -        const win = enumerator.getNext();
    
    39
    -        this.disableWindowJS(win);
    
    40
    -      }
    
    41
    -    }
    
    42
    -
    
    43
    -    disableWindowJS(win) {
    
    44
    -      const browsers = win.gBrowser?.browsers || [];
    
    45
    -      for (const browser of browsers) {
    
    46
    -        if (!browser) {
    
    47
    -          continue;
    
    48
    -        }
    
    49
    -        this.disableBrowserJS(browser);
    
    50
    -        try {
    
    51
    -          browser.webNavigation?.stop(browser.webNavigation.STOP_ALL);
    
    52
    -        } catch (e) {
    
    53
    -          logger.warn("Could not stop navigation", e, browser.currentURI);
    
    54
    -        }
    
    55
    -      }
    
    56
    -    }
    
    57
    -
    
    58
    -    disableBrowserJS(browser) {
    
    59
    -      if (!browser) {
    
    60
    -        return;
    
    61
    -      }
    
    62
    -      // Does the following still apply?
    
    63
    -      // Solution from: https://bugzilla.mozilla.org/show_bug.cgi?id=409737
    
    64
    -      // XXX: This kills the entire window. We need to redirect
    
    65
    -      // focus and inform the user via a lightbox.
    
    66
    -      const eventSuppressor = browser.contentWindow?.windowUtils;
    
    67
    -      if (browser.browsingContext) {
    
    68
    -        browser.browsingContext.allowJavascript = false;
    
    69
    -      }
    
    70
    -      try {
    
    71
    -        // My estimation is that this does not get the inner iframe windows,
    
    72
    -        // but that does not matter, because iframes should be destroyed
    
    73
    -        // on the next load.
    
    74
    -        // Should we log when browser.contentWindow is null?
    
    75
    -        if (browser.contentWindow) {
    
    76
    -          browser.contentWindow.name = null;
    
    77
    -          browser.contentWindow.window.name = null;
    
    78
    -        }
    
    79
    -      } catch (e) {
    
    80
    -        logger.warn("Failed to reset window.name", e);
    
    81
    -      }
    
    82
    -      eventSuppressor?.suppressEventHandling(true);
    
    83
    -    }
    
    84
    -
    
    85
    -    // Clear state
    
    86
    -
    
    87
    -    async clearState() {
    
    88
    -      logger.info("Clearing the state");
    
    89
    -      this.closeTabs();
    
    90
    -      this.clearSearchBar();
    
    91
    -      this.clearPrivateSessionHistory();
    
    92
    -      this.clearHTTPAuths();
    
    93
    -      this.clearCryptoTokens();
    
    94
    -      this.clearOCSPCache();
    
    95
    -      this.clearSecuritySettings();
    
    96
    -      this.clearImageCaches();
    
    97
    -      this.clearStorage();
    
    98
    -      this.clearPreferencesAndPermissions();
    
    99
    -      await this.clearData();
    
    100
    -      await this.reloadAddons();
    
    101
    -      this.clearConnections();
    
    102
    -      this.clearPrivateSession();
    
    103
    -    }
    
    104
    -
    
    105
    -    clearSiteSpecificZoom() {
    
    106
    -      Services.prefs.setBoolPref(
    
    107
    -        "browser.zoom.siteSpecific",
    
    108
    -        !Services.prefs.getBoolPref("browser.zoom.siteSpecific")
    
    109
    -      );
    
    110
    -      Services.prefs.setBoolPref(
    
    111
    -        "browser.zoom.siteSpecific",
    
    112
    -        !Services.prefs.getBoolPref("browser.zoom.siteSpecific")
    
    113
    -      );
    
    114
    -    }
    
    115
    -
    
    116
    -    closeTabs() {
    
    117
    -      if (
    
    118
    -        !Services.prefs.getBoolPref("browser.new_identity.close_newnym", true)
    
    119
    -      ) {
    
    120
    -        logger.info("Not closing tabs");
    
    121
    -        return;
    
    122
    -      }
    
    123
    -      // TODO: muck around with browser.tabs.warnOnClose.. maybe..
    
    124
    -      logger.info("Closing tabs...");
    
    125
    -      const enumerator = Services.wm.getEnumerator("navigator:browser");
    
    126
    -      const windowsToClose = [];
    
    127
    -      while (enumerator.hasMoreElements()) {
    
    128
    -        const win = enumerator.getNext();
    
    129
    -        const browser = win.gBrowser;
    
    130
    -        if (!browser) {
    
    131
    -          logger.warn("No browser for possible window to close");
    
    132
    -          continue;
    
    133
    -        }
    
    134
    -        const tabsToRemove = [];
    
    135
    -        for (const b of browser.browsers) {
    
    136
    -          const tab = browser.getTabForBrowser(b);
    
    137
    -          if (tab) {
    
    138
    -            tabsToRemove.push(tab);
    
    139
    -          } else {
    
    140
    -            logger.warn("Browser has a null tab", b);
    
    141
    -          }
    
    142
    -        }
    
    143
    -        if (win == window) {
    
    144
    -          browser.addWebTab("about:blank");
    
    145
    -        } else {
    
    146
    -          // It is a bad idea to alter the window list while iterating
    
    147
    -          // over it, so add this window to an array and close it later.
    
    148
    -          windowsToClose.push(win);
    
    149
    -        }
    
    150
    -        // Close each tab except the new blank one that we created.
    
    151
    -        tabsToRemove.forEach(aTab => browser.removeTab(aTab));
    
    152
    -      }
    
    153
    -      // Close all XUL windows except this one.
    
    154
    -      logger.info("Closing windows...");
    
    155
    -      windowsToClose.forEach(aWin => aWin.close());
    
    156
    -      logger.info("Closed all tabs");
    
    157
    -
    
    158
    -      // This clears the undo tab history.
    
    159
    -      const tabs = Services.prefs.getIntPref(
    
    160
    -        "browser.sessionstore.max_tabs_undo"
    
    161
    -      );
    
    162
    -      Services.prefs.setIntPref("browser.sessionstore.max_tabs_undo", 0);
    
    163
    -      Services.prefs.setIntPref("browser.sessionstore.max_tabs_undo", tabs);
    
    164
    -    }
    
    165
    -
    
    166
    -    clearSearchBar() {
    
    167
    -      logger.info("Clearing searchbox");
    
    168
    -      // Bug #10800: Trying to clear search/find can cause exceptions
    
    169
    -      // in unknown cases. Just log for now.
    
    170
    -      try {
    
    171
    -        const searchBar = window.document.getElementById("searchbar");
    
    172
    -        if (searchBar) {
    
    173
    -          searchBar.textbox.reset();
    
    174
    -        }
    
    175
    -      } catch (e) {
    
    176
    -        logger.error("Exception on clearing search box", e);
    
    177
    -      }
    
    178
    -      try {
    
    179
    -        if (gFindBarInitialized) {
    
    180
    -          const findbox = gFindBar.getElement("findbar-textbox");
    
    181
    -          findbox.reset();
    
    182
    -          gFindBar.close();
    
    183
    -        }
    
    184
    -      } catch (e) {
    
    185
    -        logger.error("Exception on clearing find bar", e);
    
    186
    -      }
    
    187
    -    }
    
    188
    -
    
    189
    -    clearPrivateSessionHistory() {
    
    190
    -      logger.info("Emitting Private Browsing Session clear event");
    
    191
    -      Services.obs.notifyObservers(null, "browser:purge-session-history");
    
    192
    -    }
    
    193
    -
    
    194
    -    clearHTTPAuths() {
    
    195
    -      if (
    
    196
    -        !Services.prefs.getBoolPref(
    
    197
    -          "browser.new_identity.clear_http_auth",
    
    198
    -          true
    
    199
    -        )
    
    200
    -      ) {
    
    201
    -        logger.info("Skipping HTTP Auths, because disabled");
    
    202
    -        return;
    
    203
    -      }
    
    204
    -      logger.info("Clearing HTTP Auths");
    
    205
    -      const auth = Cc["@mozilla.org/network/http-auth-manager;1"].getService(
    
    206
    -        Ci.nsIHttpAuthManager
    
    207
    -      );
    
    208
    -      auth.clearAll();
    
    209
    -    }
    
    210
    -
    
    211
    -    clearCryptoTokens() {
    
    212
    -      logger.info("Clearing Crypto Tokens");
    
    213
    -      // Clear all crypto auth tokens. This includes calls to PK11_LogoutAll(),
    
    214
    -      // nsNSSComponent::LogoutAuthenticatedPK11() and clearing the SSL session
    
    215
    -      // cache.
    
    216
    -      const sdr = Cc["@mozilla.org/security/sdr;1"].getService(
    
    217
    -        Ci.nsISecretDecoderRing
    
    218
    -      );
    
    219
    -      sdr.logoutAndTeardown();
    
    220
    -    }
    
    221
    -
    
    222
    -    clearOCSPCache() {
    
    223
    -      // nsNSSComponent::Observe() watches security.OCSP.enabled, which calls
    
    224
    -      // setValidationOptions(), which in turn calls setNonPkixOcspEnabled() which,
    
    225
    -      // if security.OCSP.enabled is set to 0, calls CERT_DisableOCSPChecking(),
    
    226
    -      // which calls CERT_ClearOCSPCache().
    
    227
    -      // See: https://mxr.mozilla.org/comm-esr24/source/mozilla/security/manager/ssl/src/nsNSSComponent.cpp
    
    228
    -      const ocsp = Services.prefs.getIntPref("security.OCSP.enabled");
    
    229
    -      Services.prefs.setIntPref("security.OCSP.enabled", 0);
    
    230
    -      Services.prefs.setIntPref("security.OCSP.enabled", ocsp);
    
    231
    -    }
    
    232
    -
    
    233
    -    clearSecuritySettings() {
    
    234
    -      // Clear site security settings
    
    235
    -      const sss = Cc["@mozilla.org/ssservice;1"].getService(
    
    236
    -        Ci.nsISiteSecurityService
    
    237
    -      );
    
    238
    -      sss.clearAll();
    
    239
    -    }
    
    240
    -
    
    241
    -    clearImageCaches() {
    
    242
    -      logger.info("Clearing Image Cache");
    
    243
    -      // In Firefox 18 and newer, there are two image caches: one that is used
    
    244
    -      // for regular browsing, and one that is used for private browsing.
    
    245
    -      this.clearImageCacheRB();
    
    246
    -      this.clearImageCachePB();
    
    247
    -    }
    
    248
    -
    
    249
    -    clearImageCacheRB() {
    
    250
    -      try {
    
    251
    -        const imgTools = Cc["@mozilla.org/image/tools;1"].getService(
    
    252
    -          Ci.imgITools
    
    253
    -        );
    
    254
    -        const imgCache = imgTools.getImgCacheForDocument(null);
    
    255
    -        // Evict all but chrome cache
    
    256
    -        imgCache.clearCache(false);
    
    257
    -      } catch (e) {
    
    258
    -        // FIXME: This can happen in some rare cases involving XULish image data
    
    259
    -        // in combination with our image cache isolation patch. Sure isn't
    
    260
    -        // a good thing, but it's not really a super-cookie vector either.
    
    261
    -        // We should fix it eventually.
    
    262
    -        logger.error("Exception on image cache clearing", e);
    
    263
    -      }
    
    264
    -    }
    
    265
    -
    
    266
    -    clearImageCachePB() {
    
    267
    -      const imgTools = Cc["@mozilla.org/image/tools;1"].getService(
    
    268
    -        Ci.imgITools
    
    269
    -      );
    
    270
    -      try {
    
    271
    -        // Try to clear the private browsing cache. To do so, we must locate a
    
    272
    -        // content document that is contained within a private browsing window.
    
    273
    -        let didClearPBCache = false;
    
    274
    -        const enumerator = Services.wm.getEnumerator("navigator:browser");
    
    275
    -        while (!didClearPBCache && enumerator.hasMoreElements()) {
    
    276
    -          const win = enumerator.getNext();
    
    277
    -          let browserDoc = win.document.documentElement;
    
    278
    -          if (!browserDoc.hasAttribute("privatebrowsingmode")) {
    
    279
    -            continue;
    
    280
    -          }
    
    281
    -          const tabbrowser = win.gBrowser;
    
    282
    -          if (!tabbrowser) {
    
    283
    -            continue;
    
    284
    -          }
    
    285
    -          for (const browser of tabbrowser.browsers) {
    
    286
    -            const doc = browser.contentDocument;
    
    287
    -            if (doc) {
    
    288
    -              const imgCache = imgTools.getImgCacheForDocument(doc);
    
    289
    -              // Evict all but chrome cache
    
    290
    -              imgCache.clearCache(false);
    
    291
    -              didClearPBCache = true;
    
    292
    -              break;
    
    293
    -            }
    
    294
    -          }
    
    295
    -        }
    
    296
    -      } catch (e) {
    
    297
    -        logger.error("Exception on private browsing image cache clearing", e);
    
    298
    -      }
    
    299
    -    }
    
    300
    -
    
    301
    -    clearStorage() {
    
    302
    -      logger.info("Clearing Disk and Memory Caches");
    
    303
    -      try {
    
    304
    -        Services.cache2.clear();
    
    305
    -      } catch (e) {
    
    306
    -        logger.error("Exception on cache clearing", e);
    
    307
    -      }
    
    308
    -
    
    309
    -      logger.info("Clearing Cookies and DOM Storage");
    
    310
    -      Services.cookies.removeAll();
    
    311
    -    }
    
    312
    -
    
    313
    -    clearPreferencesAndPermissions() {
    
    314
    -      logger.info("Clearing Content Preferences");
    
    315
    -      ChromeUtils.defineESModuleGetters(this, {
    
    316
    -        PrivateBrowsingUtils:
    
    317
    -          "resource://gre/modules/PrivateBrowsingUtils.sys.mjs",
    
    318
    -      });
    
    319
    -      const pbCtxt = PrivateBrowsingUtils.privacyContextFromWindow(window);
    
    320
    -      const cps = Cc["@mozilla.org/content-pref/service;1"].getService(
    
    321
    -        Ci.nsIContentPrefService2
    
    322
    -      );
    
    323
    -      cps.removeAllDomains(pbCtxt);
    
    324
    -      this.clearSiteSpecificZoom();
    
    325
    -
    
    326
    -      logger.info("Clearing permissions");
    
    327
    -      try {
    
    328
    -        Services.perms.removeAll();
    
    329
    -      } catch (e) {
    
    330
    -        // Actually, this catch does not appear to be needed. Leaving it in for
    
    331
    -        // safety though.
    
    332
    -        logger.error("Cannot clear permissions", e);
    
    333
    -      }
    
    334
    -
    
    335
    -      logger.info("Syncing prefs");
    
    336
    -      // Force prefs to be synced to disk
    
    337
    -      Services.prefs.savePrefFile(null);
    
    338
    -    }
    
    339
    -
    
    340
    -    async clearData() {
    
    341
    -      logger.info("Calling the clearDataService");
    
    342
    -      const flags =
    
    343
    -        Services.clearData.CLEAR_ALL ^ Services.clearData.CLEAR_PASSWORDS;
    
    344
    -      return new Promise(resolve => {
    
    345
    -        Services.clearData.deleteData(flags, {
    
    346
    -          onDataDeleted(code) {
    
    347
    -            if (code !== Cr.NS_OK) {
    
    348
    -              logger.error(`Error while calling the clearDataService: ${code}`);
    
    349
    -            }
    
    350
    -            // We always resolve, because we do not want to interrupt the new
    
    351
    -            // identity procedure.
    
    352
    -            resolve();
    
    353
    -          },
    
    354
    -        });
    
    355
    -      });
    
    356
    -    }
    
    357
    -
    
    358
    -    clearConnections() {
    
    359
    -      logger.info("Closing open connections");
    
    360
    -      // Clear keep-alive
    
    361
    -      Services.obs.notifyObservers(this, "net:prune-all-connections");
    
    362
    -    }
    
    363
    -
    
    364
    -    clearPrivateSession() {
    
    365
    -      logger.info("Ending any remaining private browsing sessions.");
    
    366
    -      Services.obs.notifyObservers(null, "last-pb-context-exited");
    
    367
    -    }
    
    368
    -
    
    369
    -    async reloadAddons() {
    
    370
    -      logger.info("Reloading add-ons to clear their temporary state.");
    
    371
    -      // Reload all active extensions except search engines, which would throw.
    
    372
    -      const addons = await AddonManager.getAddonsByTypes(["extension"]);
    
    373
    -      const isSearchEngine = async addon =>
    
    374
    -        (await (await fetch(addon.getResourceURI("manifest.json").spec)).json())
    
    375
    -          ?.chrome_settings_overrides?.search_provider;
    
    376
    -      const reloadIfNeeded = async addon =>
    
    377
    -        addon.isActive && !(await isSearchEngine(addon)) && addon.reload();
    
    378
    -      await Promise.all(addons.map(addon => reloadIfNeeded(addon)));
    
    379
    -    }
    
    380
    -
    
    381
    -    // Broadcast as a hook to clear other data
    
    382
    -
    
    383
    -    broadcast() {
    
    384
    -      logger.info("Broadcasting the new identity");
    
    385
    -      Services.obs.notifyObservers({}, topics.newIdentityRequested);
    
    386
    -    }
    
    387
    -
    
    388
    -    // Window management
    
    389
    -
    
    390
    -    openNewWindow() {
    
    391
    -      logger.info("Opening a new window");
    
    392
    -      return new Promise(resolve => {
    
    393
    -        // Open a new window forcing the about:privatebrowsing page (tor-browser#41765)
    
    394
    -        // unless user explicitly overrides this policy (tor-browser #42236)
    
    395
    -        const trustedHomePref = "browser.startup.homepage.new_identity";
    
    396
    -        const homeURL = HomePage.get();
    
    397
    -        const defaultHomeURL = HomePage.getDefault();
    
    398
    -        const isTrustedHome =
    
    399
    -          homeURL === defaultHomeURL ||
    
    400
    -          homeURL === "chrome://browser/content/blanktab.html" || // about:blank
    
    401
    -          homeURL === Services.prefs.getStringPref(trustedHomePref, "");
    
    402
    -        const isCustomHome =
    
    403
    -          Services.prefs.getIntPref("browser.startup.page") === 1;
    
    404
    -        const win = OpenBrowserWindow({
    
    405
    -          private: isCustomHome && isTrustedHome ? "private" : "no-home",
    
    406
    -        });
    
    407
    -        // This mechanism to know when the new window is ready is used by
    
    408
    -        // OpenBrowserWindow itself (see its definition in browser.js).
    
    409
    -        win.addEventListener(
    
    410
    -          "MozAfterPaint",
    
    411
    -          () => {
    
    412
    -            resolve();
    
    413
    -            if (isTrustedHome || !isCustomHome) {
    
    414
    -              return;
    
    415
    -            }
    
    416
    -            const tbl = win.TabsProgressListener;
    
    417
    -            const { onLocationChange } = tbl;
    
    418
    -            tbl.onLocationChange = (...args) => {
    
    419
    -              tbl.onLocationChange = onLocationChange;
    
    420
    -              tbl.onLocationChange(...args);
    
    421
    -              const url = URL.parse(homeURL);
    
    422
    -              if (!url) {
    
    423
    -                // malformed URL, bail out
    
    424
    -                return;
    
    425
    -              }
    
    426
    -
    
    427
    -              let displayAddress = url.hostname;
    
    428
    -              if (!displayAddress) {
    
    429
    -                // no host, use full address and truncate if too long
    
    430
    -                const MAX_LEN = 32;
    
    431
    -                displayAddress = url.href;
    
    432
    -                if (displayAddress.length > MAX_LEN) {
    
    433
    -                  displayAddress = `${displayAddress.substring(0, MAX_LEN)}…`;
    
    434
    -                }
    
    435
    -              }
    
    436
    -              const callback = () => {
    
    437
    -                Services.prefs.setStringPref(trustedHomePref, homeURL);
    
    438
    -                win.BrowserHome();
    
    439
    -              };
    
    440
    -              const notificationBox = win.gBrowser.getNotificationBox();
    
    441
    -              notificationBox.appendNotification(
    
    442
    -                "new-identity-safe-home",
    
    443
    -                {
    
    444
    -                  label: {
    
    445
    -                    "l10n-id": "new-identity-blocked-home-notification",
    
    446
    -                    "l10n-args": { url: displayAddress },
    
    447
    -                  },
    
    448
    -                  priority: notificationBox.PRIORITY_INFO_MEDIUM,
    
    449
    -                },
    
    450
    -                [
    
    451
    -                  {
    
    452
    -                    "l10n-id": "new-identity-blocked-home-ignore-button",
    
    453
    -                    callback,
    
    454
    -                  },
    
    455
    -                ]
    
    456
    -              );
    
    457
    -            };
    
    458
    -          },
    
    459
    -          { once: true }
    
    460
    -        );
    
    461
    -      });
    
    462
    -    }
    
    463
    -
    
    464
    -    closeOldWindow() {
    
    465
    -      logger.info("Closing the old window");
    
    466
    -
    
    467
    -      // Run garbage collection and cycle collection after window is gone.
    
    468
    -      // This ensures that blob URIs are forgotten.
    
    469
    -      window.addEventListener("unload", function () {
    
    470
    -        logger.debug("Initiating New Identity GC pass");
    
    471
    -        // Clear out potential pending sInterSliceGCTimer:
    
    472
    -        window.windowUtils.runNextCollectorTimer();
    
    473
    -        // Clear out potential pending sICCTimer:
    
    474
    -        window.windowUtils.runNextCollectorTimer();
    
    475
    -        // Schedule a garbage collection in 4000-1000ms...
    
    476
    -        window.windowUtils.garbageCollect();
    
    477
    -        // To ensure the GC runs immediately instead of 4-10s from now, we need
    
    478
    -        // to poke it at least 11 times.
    
    479
    -        // We need 5 pokes for GC, 1 poke for the interSliceGC, and 5 pokes for
    
    480
    -        // CC.
    
    481
    -        // See nsJSContext::RunNextCollectorTimer() in
    
    482
    -        // https://mxr.mozilla.org/mozilla-central/source/dom/base/nsJSEnvironment.cpp#1970.
    
    483
    -        // XXX: We might want to make our own method for immediate full GC...
    
    484
    -        for (let poke = 0; poke < 11; poke++) {
    
    485
    -          window.windowUtils.runNextCollectorTimer();
    
    486
    -        }
    
    487
    -        // And now, since the GC probably actually ran *after* the CC last time,
    
    488
    -        // run the whole thing again.
    
    489
    -        window.windowUtils.garbageCollect();
    
    490
    -        for (let poke = 0; poke < 11; poke++) {
    
    491
    -          window.windowUtils.runNextCollectorTimer();
    
    492
    -        }
    
    493
    -        logger.debug("Completed New Identity GC pass");
    
    494
    -      });
    
    495
    -
    
    496
    -      // Close the current window for added safety
    
    497
    -      window.close();
    
    498
    -    }
    
    499
    -  }
    
    500
    -
    
    501
    -  let newIdentityInProgress = false;
    
    502
    -  return {
    
    503
    -    async onCommand() {
    
    504
    -      try {
    
    505
    -        // Ignore if there's a New Identity in progress to avoid race
    
    506
    -        // conditions leading to failures (see bug 11783 for an example).
    
    507
    -        if (newIdentityInProgress) {
    
    508
    -          return;
    
    509
    -        }
    
    510
    -        newIdentityInProgress = true;
    
    511
    -
    
    512
    -        const prefConfirm = "browser.new_identity.confirm_newnym";
    
    513
    -        const shouldConfirm = Services.prefs.getBoolPref(prefConfirm, true);
    
    514
    -        if (shouldConfirm) {
    
    515
    -          const [titleString, bodyString, checkboxString, restartString] =
    
    516
    -            await document.l10n.formatValues([
    
    517
    -              { id: "new-identity-dialog-title" },
    
    518
    -              { id: "new-identity-dialog-description" },
    
    519
    -              { id: "restart-warning-dialog-do-not-warn-checkbox" },
    
    520
    -              { id: "restart-warning-dialog-restart-button" },
    
    521
    -            ]);
    
    522
    -          const flags =
    
    523
    -            Services.prompt.BUTTON_POS_0 *
    
    524
    -              Services.prompt.BUTTON_TITLE_IS_STRING +
    
    525
    -            Services.prompt.BUTTON_POS_0_DEFAULT +
    
    526
    -            Services.prompt.BUTTON_DEFAULT_IS_DESTRUCTIVE +
    
    527
    -            Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL;
    
    528
    -          const propBag = await Services.prompt.asyncConfirmEx(
    
    529
    -            window.browsingContext,
    
    530
    -            Services.prompt.MODAL_TYPE_INTERNAL_WINDOW,
    
    531
    -            titleString,
    
    532
    -            bodyString,
    
    533
    -            flags,
    
    534
    -            restartString,
    
    535
    -            null,
    
    536
    -            null,
    
    537
    -            checkboxString,
    
    538
    -            false
    
    539
    -          );
    
    540
    -          if (propBag.get("buttonNumClicked") !== 0) {
    
    541
    -            return;
    
    542
    -          }
    
    543
    -          if (propBag.get("checked")) {
    
    544
    -            Services.prefs.setBoolPref(prefConfirm, false);
    
    545
    -          }
    
    546
    -        }
    
    547
    -
    
    548
    -        const impl = new NewIdentityImpl();
    
    549
    -        await impl.run();
    
    550
    -      } catch (e) {
    
    551
    -        // If something went wrong make sure we have the New Identity button
    
    552
    -        // enabled (again).
    
    553
    -        logger.error("Unexpected error", e);
    
    554
    -        window.alert("New Identity unexpected error: " + e);
    
    555
    -      } finally {
    
    556
    -        newIdentityInProgress = false;
    
    557
    -      }
    
    558
    -    },
    
    559
    -  };
    
    560
    -});

  • browser/components/newidentity/jar.mn deleted
    1
    -browser.jar:
    
    2
    -    content/browser/newidentity.js             (content/newidentity.js)

  • browser/components/newidentity/moz.build deleted
    1
    -JAR_MANIFESTS += ["jar.mn"]

  • browser/modules/BrowserWindowTracker.sys.mjs
    ... ... @@ -345,10 +345,7 @@ export const BrowserWindowTracker = {
    345 345
         let loadURIString;
    
    346 346
         if (isPrivate && lazy.PrivateBrowsingUtils.enabled) {
    
    347 347
           windowFeatures += ",private";
    
    348
    -      if (
    
    349
    -        (!args && !lazy.PrivateBrowsingUtils.permanentPrivateBrowsing) ||
    
    350
    -        args?.private === "no-home"
    
    351
    -      ) {
    
    348
    +      if (!args && !lazy.PrivateBrowsingUtils.permanentPrivateBrowsing) {
    
    352 349
             // Force the new window to load about:privatebrowsing instead of the
    
    353 350
             // default home page.
    
    354 351
             loadURIString = "about:privatebrowsing";
    

  • browser/themes/shared/icons/new_identity.svg deleted
    1
    -<?xml version="1.0" encoding="UTF-8"?>
    
    2
    -<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    
    3
    -    <g fill="context-fill" fill-opacity="context-fill-opacity">
    
    4
    -        <path d="m13.5383 14.5627c-.1712-.0053-.3194-.1334-.3505-.3028-.0419-.294-.1441-.5789-.3001-.8369-.2583-.1558-.5436-.2579-.838-.2998-.1694-.0313-.2974-.1793-.3026-.3501-.0053-.1708.1136-.3146.2813-.3402.2944-.0329.5762-.1254.8284-.272.1426-.2476.2313-.5243.2608-.8129.0237-.1679.1662-.2884.3372-.2851.1699.0042.3181.1295.3517.2973.0471.2931.1533.5763.312.8323.2565.1573.5396.263.8326.3109.1682.0345.2929.1836.2958.3536.0028.17-.1171.3116-.2843.3357-.2894.0285-.5669.1172-.8147.2604-.1462.2521-.2386.5335-.2717.8274-.025.167-.1675.2861-.3379.2822z"/>
    
    5
    -        <path d="m6.49858 2.99992c-.14675-.00459-.27377-.11436-.3004-.25961-.03593-.25196-.12354-.49621-.25729-.71731-.22137-.13358-.46594-.22109-.71822-.25699-.14526-.02682-.25492-.15363-.25945-.30004-.00454-.14641.09737-.26967.24112-.29164.25236-.02817.49393-.10747.71013-.233093.12217-.2123.19825-.449454.22353-.696834.0203-.143878.14242-.24714456.28897-.24434753.14565.00358504.27273.11100153.30149.25484453.0404.251183.13139.493923.2674.713349.21988.134841.46256.225461.71364.266481.14417.02957.25114.15744.25358.30313.00244.1457-.10035.26707-.24368.28774-.2481.02441-.48592.10041-.69835.22319-.1253.2161-.20449.45729-.23284.7092-.0214.14312-.14361.24521-.28963.24193z"/>
    
    6
    -        <path d="m1.82093 5.3609c-.15279-.00473-.28512-.11875-.31315-.26981-.02739-.18014-.08781-.35525-.1782-.51643-.16152-.09021-.336989-.15052-.517512-.17788-.151437-.02794-.265749-.16003-.270474-.31254-.004724-.15251.101518-.2809.251381-.30378.181146-.02145.355265-.07593.513815-.16075.08209-.15545.13363-.32622.15197-.50355.02095-.15059.14903-.25861.3025-.25512.15164.00368.28404.11525.31428.26484.03021.18029.09338.35503.18632.51538.16048.09192.33508.15452.51517.18469.1503.0308.26181.164.26435.31577.00254.15176-.10462.27819-.25404.29971-.17764.01914-.34855.07141-.50396.15412-.08502.1582-.13963.33194-.16114.5127-.022.14911-.14912.25571-.30131.25265z"/>
    
    7
    -        <path clip-rule="evenodd" d="m15.3213 1.06694c.2441-.244076.2441-.639804 0-.883882-.2441-.2440775-.6398-.2440774-.8839 0l-5.96506 5.965062h-.50519c-1.996-1.09517-4.49023.42233-6.49079 1.63948-.41545.25277-.80961.49258-1.173597.69335-.16756.10002-.289261.26641-.30145394.48048-.01219156.21407.06079654.41038.21802994.56743l1.243691 1.24224 2.37084-1.02603c.15392-.06661.30331.14022.18601.25753l-1.66213 1.6621 1.46329 1.4616 1.66126-1.6613c.1173-.1173.32413.0321.25752.186l-1.02482 2.3682 1.25462 1.2531c.15724.157.35379.23.56815.2178.19095-.0561.35851-.1561.45869-.3234.20012-.3592.43577-.7455.68321-1.1511 1.22241-2.0039 2.73233-4.47901 1.66484-6.47533v-.49654zm-7.46715 6.55077c1.12692 1.12692.64113 2.69369-.05278 3.70149h-.50137l-3.13-3.1492v-.5c1.00858-.68566 2.56556-1.17088 3.68415-.05229z" fill-rule="evenodd"/>
    
    8
    -    </g>
    
    9
    -</svg>

  • browser/themes/shared/jar.inc.mn
    ... ... @@ -332,5 +332,3 @@
    332 332
     
    
    333 333
       skin/classic/browser/illustrations/market-opt-in.svg         (../shared/illustrations/market-opt-in.svg)
    
    334 334
       skin/classic/browser/illustrations/yelpRealtime-opt-in.svg   (../shared/illustrations/yelpRealtime-opt-in.svg)
    335
    -
    
    336
    -  skin/classic/browser/new_identity.svg                        (../shared/icons/new_identity.svg)

  • browser/themes/shared/toolbarbutton-icons.css
    ... ... @@ -87,10 +87,6 @@
    87 87
       list-style-image: url("chrome://browser/skin/new-tab.svg");
    
    88 88
     }
    
    89 89
     
    
    90
    -#new-identity-button {
    
    91
    -  list-style-image: url("chrome://browser/skin/new_identity.svg");
    
    92
    -}
    
    93
    -
    
    94 90
     #privatebrowsing-button {
    
    95 91
       list-style-image: url("chrome://browser/skin/privateBrowsing.svg");
    
    96 92
     }
    

  • eslint-file-globals.config.mjs
    ... ... @@ -134,7 +134,6 @@ export default [
    134 134
           "testing/mochitest/browser-test.js",
    
    135 135
           "toolkit/components/printing/content/printPreviewPagination.js",
    
    136 136
           "toolkit/components/printing/content/printUtils.js",
    
    137
    -      "browser/components/newidentity/content/newidentity.js",
    
    138 137
         ],
    
    139 138
         languageOptions: {
    
    140 139
           globals: mozilla.environments["browser-window"].globals,
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx