mirror of
https://github.com/zen-browser/desktop.git
synced 2026-07-18 06:31:04 +00:00
fix: Fixed tabs becoming empty tabs when switching between windows, b=bug #12421, c=no-component
This commit is contained in:
@@ -30,10 +30,6 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
||||
3
|
||||
);
|
||||
|
||||
const SHOULD_LOG_TAB_ENTRIES = Services.prefs.getBoolPref(
|
||||
"zen.session-store.log-tab-entries",
|
||||
false
|
||||
);
|
||||
const SHOULD_BACKUP_FILE = Services.prefs.getBoolPref("zen.session-store.backup-file", true);
|
||||
const FILE_NAME = "zen-sessions.jsonlz4";
|
||||
|
||||
@@ -236,7 +232,7 @@ export class nsZenSessionManager {
|
||||
this._shouldRunMigration = true;
|
||||
await this.#getDataFromDBForMigration();
|
||||
}
|
||||
if (SHOULD_LOG_TAB_ENTRIES) {
|
||||
if (Services.prefs.getBoolPref("zen.session-store.log-tab-entries", false)) {
|
||||
for (const tab of this.#sidebar.tabs || []) {
|
||||
this.log("Tab entry in session file:", tab);
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ class nsZenWindowSync {
|
||||
return;
|
||||
}
|
||||
lazy.TabStateCache.update(aOurTab.linkedBrowser.permanentKey, {
|
||||
history: tabStateEntries,
|
||||
history: Cu.cloneInto(tabStateEntries, {}),
|
||||
});
|
||||
};
|
||||
// Running `swapBrowsersAndCloseOther` doesn't expect us to use the tab after
|
||||
@@ -815,17 +815,19 @@ class nsZenWindowSync {
|
||||
});
|
||||
|
||||
let promise = this.#createPseudoImageForBrowser(otherBrowser, mySrc);
|
||||
|
||||
await Promise.all([promiseToWait, promise]);
|
||||
callback();
|
||||
otherBrowser.setAttribute("zen-pseudo-hidden", "true");
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
} else {
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
lazy.setTimeout(() => {
|
||||
otherBrowser.setAttribute("zen-pseudo-hidden", "true");
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
ourBrowser.focus();
|
||||
resolve();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
ourBrowser.removeAttribute("zen-pseudo-hidden");
|
||||
this.#maybeRemovePseudoImageForBrowser(ourBrowser);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user