mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Fixed 'switch tab' not working when tabs are unloaded, b=no-bug, c=workspaces
This commit is contained in:
13
src/browser/components/urlbar/UrlbarController-sys-mjs.patch
Normal file
13
src/browser/components/urlbar/UrlbarController-sys-mjs.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/browser/components/urlbar/UrlbarController.sys.mjs b/browser/components/urlbar/UrlbarController.sys.mjs
|
||||
index 4f85be7203f44c16944924d50947a89e436f00bc..518956c320af4e7045e8ff9fe63b70f8c2430b22 100644
|
||||
--- a/browser/components/urlbar/UrlbarController.sys.mjs
|
||||
+++ b/browser/components/urlbar/UrlbarController.sys.mjs
|
||||
@@ -410,7 +410,7 @@ export class UrlbarController {
|
||||
// When there's no search string and no view selection, we want to focus
|
||||
// the next toolbar item instead, for accessibility reasons.
|
||||
let allowTabbingThroughResults =
|
||||
- this.input.focusedViaMousedown ||
|
||||
+ true ||
|
||||
this.input.searchMode?.isPreview ||
|
||||
this.view.selectedElement ||
|
||||
(this.input.value &&
|
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/themes/shared/urlbar-searchbar.css b/browser/themes/shared/urlbar-searchbar.css
|
||||
index 23661cf489d97cdbd6d4c66de199fd9dc0c8475f..2677dc60a92cebe014c817414a6067be9543cf98 100644
|
||||
index d6c0b56270aee3dd0e74840314ea25af3ca8050a..17b22809744a8903b916b7769681a0c14d054f45 100644
|
||||
--- a/browser/themes/shared/urlbar-searchbar.css
|
||||
+++ b/browser/themes/shared/urlbar-searchbar.css
|
||||
@@ -5,7 +5,7 @@
|
||||
@@ -11,7 +11,16 @@ index 23661cf489d97cdbd6d4c66de199fd9dc0c8475f..2677dc60a92cebe014c817414a6067be
|
||||
--urlbar-margin-inline: 5px;
|
||||
--urlbar-padding-block: 4px;
|
||||
}
|
||||
@@ -303,10 +303,14 @@
|
||||
@@ -23,7 +23,7 @@
|
||||
#urlbar:not([usertyping]) > .urlbar-input-container > .urlbar-go-button,
|
||||
#urlbar:not([focused]) > .urlbar-input-container > .urlbar-go-button,
|
||||
#urlbar-revert-button-container {
|
||||
- display: none;
|
||||
+ display: none !important;
|
||||
}
|
||||
|
||||
/* When rich suggestions are enabled the urlbar identity icon is given extra padding to
|
||||
@@ -288,10 +288,14 @@
|
||||
|
||||
#urlbar[breakout][breakout-extend] {
|
||||
height: auto;
|
||||
|
@@ -2772,7 +2772,12 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
}
|
||||
}
|
||||
}
|
||||
this._allStoredTabs = tabs;
|
||||
const currentWorkspace = this.activeWorkspace;
|
||||
this._allStoredTabs = tabs.sort((a, b) => {
|
||||
const aWorkspaceId = a.getAttribute('zen-workspace-id');
|
||||
const bWorkspaceId = b.getAttribute('zen-workspace-id');
|
||||
return aWorkspaceId === currentWorkspace ? -1 : bWorkspaceId === currentWorkspace ? 1 : 0;
|
||||
});
|
||||
return this._allStoredTabs;
|
||||
}
|
||||
|
||||
@@ -2807,20 +2812,14 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
if (!this._hasInitializedTabsStrip) {
|
||||
return gBrowser.browsers;
|
||||
}
|
||||
const browsers = Array.from(gBrowser.tabpanels.querySelectorAll('browser'));
|
||||
// Sort browsers by making the current workspace first
|
||||
const currentWorkspace = this.activeWorkspace;
|
||||
const sortedBrowsers = browsers.sort((a, b) => {
|
||||
const aTab = gBrowser.getTabForBrowser(a);
|
||||
const bTab = gBrowser.getTabForBrowser(b);
|
||||
if (!bTab || !aTab) {
|
||||
return 0;
|
||||
const browsers = [];
|
||||
for (const tab of this.allStoredTabs) {
|
||||
const browser = tab.linkedBrowser;
|
||||
if (browser) {
|
||||
browsers.push(browser);
|
||||
}
|
||||
const aWorkspaceId = aTab.getAttribute('zen-workspace-id');
|
||||
const bWorkspaceId = bTab.getAttribute('zen-workspace-id');
|
||||
return aWorkspaceId === currentWorkspace ? -1 : bWorkspaceId === currentWorkspace ? 1 : 0;
|
||||
});
|
||||
return sortedBrowsers;
|
||||
}
|
||||
return browsers;
|
||||
}
|
||||
|
||||
get pinnedTabCount() {
|
||||
|
Reference in New Issue
Block a user