diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 0ea3d82b88819c41ffd866ae9533ebb5a7bff957..37db181d7e71fb6250df5bae363e9cf984b44f79 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -33,6 +33,7 @@ ChromeUtils.defineESModuleGetters(this, {
     "resource://gre/modules/ContextualIdentityService.sys.mjs",
   CustomizableUI:
     "moz-src:///browser/components/customizableui/CustomizableUI.sys.mjs",
+  ZenCustomizableUI: "resource:///modules/ZenCustomizableUI.sys.mjs",
   DevToolsSocketStatus:
     "resource://devtools/shared/security/DevToolsSocketStatus.sys.mjs",
   DownloadUtils: "resource://gre/modules/DownloadUtils.sys.mjs",
@@ -814,7 +815,12 @@ function UpdateBackForwardCommands(aWebNavigation) {
 
   var backDisabled = backCommand.hasAttribute("disabled");
   var forwardDisabled = forwardCommand.hasAttribute("disabled");
-  if (backDisabled == aWebNavigation.canGoBack) {
+  var canGoBack = aWebNavigation.canGoBack;
+  if (!canGoBack) {
+    canGoBack = gZenCommonActions.shouldCloseTabOnBack();
+  }
+  
+  if (backDisabled == canGoBack) {
     if (backDisabled) {
       backCommand.removeAttribute("disabled");
     } else {
@@ -2305,6 +2311,8 @@ var XULBrowserWindow = {
     AboutReaderParent.updateReaderButton(gBrowser.selectedBrowser);
     TranslationsParent.onLocationChange(gBrowser.selectedBrowser);
 
+    gZenPinnedTabManager.onLocationChange(gBrowser.selectedBrowser, location);
+
     PictureInPicture.updateUrlbarToggle(gBrowser.selectedBrowser);
 
     if (!gMultiProcessBrowser) {
@@ -3820,7 +3828,7 @@ function warnAboutClosingWindow() {
 
   if (!isPBWindow && !toolbar.visible) {
     return gBrowser.warnAboutClosingTabs(
-      gBrowser.openTabs.length,
+      gBrowser.visibleTabs.filter(t => t.getAttribute("pending")!=="true").length,
       gBrowser.closingTabsEnum.ALL
     );
   }
@@ -3860,7 +3868,7 @@ function warnAboutClosingWindow() {
     return (
       isPBWindow ||
       gBrowser.warnAboutClosingTabs(
-        gBrowser.openTabs.length,
+        gBrowser.visibleTabs.filter(t => t.getAttribute("pending")!=="true").length,
         gBrowser.closingTabsEnum.ALL
       )
     );
@@ -3885,7 +3893,7 @@ function warnAboutClosingWindow() {
     AppConstants.platform != "macosx" ||
     isPBWindow ||
     gBrowser.warnAboutClosingTabs(
-      gBrowser.openTabs.length,
+      gBrowser.visibleTabs.filter(t => t.getAttribute("pending")!=="true").length,
       gBrowser.closingTabsEnum.ALL
     )
   );
@@ -4825,6 +4833,9 @@ var ConfirmationHint = {
     }
 
     document.l10n.setAttributes(this._message, messageId, options.l10nArgs);
+    if (window.gZenUIManager?.showToast) {
+      return window.gZenUIManager.showToast(messageId, options);
+    }
     if (options.descriptionId) {
       document.l10n.setAttributes(this._description, options.descriptionId);
       this._description.hidden = false;
