mirror of
https://github.com/zen-browser/desktop
synced 2026-04-25 17:15:00 +02:00
53 lines
1.9 KiB
C++
53 lines
1.9 KiB
C++
diff --git a/browser/base/content/browser-commands.js b/browser/base/content/browser-commands.js
|
|
index e7f88f69fcc22efca4c7fc0363b9fe2729e1be6f..d7c4063d38576a34545b9af06c37937dc9090628 100644
|
|
--- a/browser/base/content/browser-commands.js
|
|
+++ b/browser/base/content/browser-commands.js
|
|
@@ -14,6 +14,10 @@ var BrowserCommands = {
|
|
const where = BrowserUtils.whereToOpenLink(aEvent, false, true);
|
|
|
|
if (where == "current") {
|
|
+ if (!gBrowser.webNavigation.canGoBack && gZenCommonActions.shouldCloseTabOnBack()) {
|
|
+ gBrowser.removeTab(gBrowser.selectedTab, { animate: true });
|
|
+ return;
|
|
+ }
|
|
try {
|
|
gBrowser.goBack();
|
|
} catch (ex) {}
|
|
@@ -229,6 +233,10 @@ var BrowserCommands = {
|
|
}
|
|
}
|
|
|
|
+ if (gZenUIManager.handleNewTab(werePassedURL, searchClipboard, where)) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
// A notification intended to be useful for modular peformance tracking
|
|
// starting as close as is reasonably possible to the time when the user
|
|
// expressed the intent to open a new tab. Since there are a lot of
|
|
@@ -313,6 +321,14 @@ var BrowserCommands = {
|
|
return;
|
|
}
|
|
|
|
+ if (gBrowser.selectedTab.hasAttribute("zen-empty-tab")) {
|
|
+ if (gBrowser.selectedTab.hasAttribute("split-view")) {
|
|
+ return;
|
|
+ }
|
|
+ gZenWorkspaces.handleTabCloseWindow();
|
|
+ return;
|
|
+ }
|
|
+
|
|
// Keyboard shortcuts that would close a tab that is pinned select the first
|
|
// unpinned tab instead.
|
|
if (
|
|
@@ -320,8 +336,8 @@ var BrowserCommands = {
|
|
(event.ctrlKey || event.metaKey || event.altKey) &&
|
|
gBrowser.selectedTab.pinned
|
|
) {
|
|
- if (gBrowser.visibleTabs.length > gBrowser.pinnedTabCount) {
|
|
- gBrowser.tabContainer.selectedIndex = gBrowser.pinnedTabCount;
|
|
+ if (gBrowser.visibleTabs.length > gBrowser._numVisiblePinTabs) {
|
|
+ gBrowser.tabContainer.selectedIndex = gBrowser._numVisiblePinTabs;
|
|
}
|
|
return;
|
|
}
|