let docElement = document.documentElement; docElement.setAttribute( "privatebrowsingmode", PrivateBrowsingUtils.permanentPrivateBrowsing ? "permanent" : "temporary" ); gBrowser.updateTitlebar(); if (PrivateBrowsingUtils.permanentPrivateBrowsing) { let hideNewWindowItem = (windowItem, privateWindowItem) => { // In permanent browsing mode command "cmd_newNavigator" should act the // same as "Tools:PrivateBrowsing". // So we hide the redundant private window item. But we also rename the // "new window" item to be "new private window". // NOTE: We choose to hide privateWindowItem rather than windowItem so // that we still show the "key" for "cmd_newNavigator" (Ctrl+N) rather // than (Ctrl+Shift+P). privateWindowItem.hidden = true; windowItem.setAttribute( "data-l10n-id", privateWindowItem.getAttribute("data-l10n-id") ); }; // Adjust the File menu items. hideNewWindowItem( document.getElementById("menu_newNavigator"), document.getElementById("menu_newPrivateWindow") ); // Adjust the App menu items. hideNewWindowItem( PanelMultiView.getViewNode(document, "appMenu-new-window-button2"), PanelMultiView.getViewNode( document, "appMenu-new-private-window-button2" ) ); } }, }; PK