Do not close container tabs in nightly - issue #241
This commit is contained in:
parent
ad3c227150
commit
6874d64ce7
1 changed files with 15 additions and 10 deletions
25
index.js
25
index.js
|
@ -112,6 +112,7 @@ const ContextualIdentityProxy = {
|
||||||
const ContainerService = {
|
const ContainerService = {
|
||||||
_identitiesState: {},
|
_identitiesState: {},
|
||||||
_windowMap: new Map(),
|
_windowMap: new Map(),
|
||||||
|
_containerWasEnabled: false,
|
||||||
|
|
||||||
init(installation) {
|
init(installation) {
|
||||||
// If we are just been installed, we must store some information for the
|
// If we are just been installed, we must store some information for the
|
||||||
|
@ -159,6 +160,10 @@ const ContainerService = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Let's see if containers were enabled before this addon.
|
||||||
|
this._containerWasEnabled =
|
||||||
|
ss.storage.savedConfiguration.prefs["privacy.userContext.enabled"];
|
||||||
|
|
||||||
// Enabling preferences
|
// Enabling preferences
|
||||||
|
|
||||||
PREFS.forEach((pref) => {
|
PREFS.forEach((pref) => {
|
||||||
|
@ -1005,16 +1010,16 @@ const ContainerService = {
|
||||||
|
|
||||||
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
|
for (let window of windows.browserWindows) { // eslint-disable-line prefer-const
|
||||||
// Let's close all the container tabs.
|
// Let's close all the container tabs.
|
||||||
// Note 1: we don't care if containers are supported but the current FF
|
// Note: We cannot use _closeTabs() because at this point tab.window is
|
||||||
// version.
|
// null.
|
||||||
// Note 2: We cannot use _closeTabs() because at this point tab.window is
|
if (!this._containerWasEnabled) {
|
||||||
// null.
|
for (let tab of window.tabs) { // eslint-disable-line prefer-const
|
||||||
for (let tab of window.tabs) { // eslint-disable-line prefer-const
|
if (this._getUserContextIdFromTab(tab)) {
|
||||||
if (this._getUserContextIdFromTab(tab)) {
|
tab.close();
|
||||||
tab.close();
|
try {
|
||||||
try {
|
SessionStore.forgetClosedTab(viewFor(window), 0);
|
||||||
SessionStore.forgetClosedTab(viewFor(window), 0);
|
} catch(e) {} // eslint-disable-line no-empty
|
||||||
} catch(e) {} // eslint-disable-line no-empty
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue