Fix command handler to look up cookieStoreId per command type
Fix command handler to look up cookieStoreId per command type
This commit is contained in:
@@ -26,19 +26,19 @@ const backgroundLogic = {
|
|||||||
for (let i=0; i < backgroundLogic.NUMBER_OF_KEYBOARD_SHORTCUTS; i++) {
|
for (let i=0; i < backgroundLogic.NUMBER_OF_KEYBOARD_SHORTCUTS; i++) {
|
||||||
const key = MAC_CONSTANTS.OPEN_CONTAINER_PREFIX + i;
|
const key = MAC_CONSTANTS.OPEN_CONTAINER_PREFIX + i;
|
||||||
const reopenKey = MAC_CONSTANTS.REOPEN_IN_CONTAINER_PREFIX + i;
|
const reopenKey = MAC_CONSTANTS.REOPEN_IN_CONTAINER_PREFIX + i;
|
||||||
const cookieStoreId = identityState.keyboardShortcut[key];
|
|
||||||
|
|
||||||
if (cookieStoreId === "none") {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (command === key) {
|
if (command === key) {
|
||||||
browser.tabs.create({cookieStoreId});
|
const cookieStoreId = identityState.keyboardShortcut[key];
|
||||||
|
if (cookieStoreId && cookieStoreId !== "none") {
|
||||||
|
browser.tabs.create({cookieStoreId});
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command === reopenKey) {
|
if (command === reopenKey) {
|
||||||
backgroundLogic.reopenInContainer(cookieStoreId);
|
const cookieStoreId = identityState.keyboardShortcut[reopenKey];
|
||||||
|
if (cookieStoreId && cookieStoreId !== "none") {
|
||||||
|
backgroundLogic.reopenInContainer(cookieStoreId);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,14 +83,14 @@ const backgroundLogic = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async reopenInContainer(cookieStoreId) {
|
async reopenInContainer(cookieStoreId) {
|
||||||
const currentTab = await browser.tabs.query({ active: true, currentWindow: true })
|
const currentTab = await browser.tabs.query({ active: true, currentWindow: true });
|
||||||
|
|
||||||
if (currentTab.length > 0) {
|
if (currentTab.length > 0) {
|
||||||
const tab = currentTab[0];
|
const tab = currentTab[0];
|
||||||
|
|
||||||
browser.tabs.create({
|
browser.tabs.create({
|
||||||
url: tab.url,
|
url: tab.url,
|
||||||
cookieStoreId: cookieStoreId,
|
cookieStoreId,
|
||||||
index: tab.index + 1,
|
index: tab.index + 1,
|
||||||
active: tab.active
|
active: tab.active
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user