зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1532841 - Don't preopen pinned tabs for private browser window r=Gijs
If we're opening a private browsing window on startup, we won't run the session restore code, and thus we won't end up cleaning up the preopened tabs. This raises the question: are there other scenarios where we won't run restoreWindow at all? Eyeballing the code I think not, but I'm not sure. Depends on D22195 Differential Revision: https://phabricator.services.mozilla.com/D22216 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
965b1cacf3
Коммит
61cadb5fd3
|
@ -386,11 +386,13 @@ window._gBrowser = {
|
|||
|
||||
_preopenPinnedTabs() {
|
||||
let numPinnedTabs = 0;
|
||||
let windows = browserWindows();
|
||||
windows.getNext();
|
||||
let isOnlyWindow = !windows.hasMoreElements();
|
||||
if (isOnlyWindow) {
|
||||
numPinnedTabs = Services.prefs.getIntPref("browser.tabs.firstWindowRestore.numPinnedTabs", 0);
|
||||
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
|
||||
let windows = browserWindows();
|
||||
windows.getNext();
|
||||
let isOnlyWindow = !windows.hasMoreElements();
|
||||
if (isOnlyWindow) {
|
||||
numPinnedTabs = Services.prefs.getIntPref("browser.tabs.firstWindowRestore.numPinnedTabs", 0);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < numPinnedTabs; i++) {
|
||||
|
@ -632,7 +634,8 @@ window._gBrowser = {
|
|||
},
|
||||
|
||||
_maybeUpdateNumPinnedTabsPref() {
|
||||
if (BrowserWindowTracker.getTopWindow() == window) {
|
||||
if (!PrivateBrowsingUtils.isWindowPrivate(window) &&
|
||||
BrowserWindowTracker.getTopWindow() == window) {
|
||||
Services.prefs.setIntPref("browser.tabs.firstWindowRestore.numPinnedTabs",
|
||||
this._numPinnedTabs);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче