ReOpenIn Picker Panel functional

This commit is contained in:
Kendall Werts 2020-02-14 17:37:02 -06:00
parent 00f1be774c
commit cc793b9025
2 changed files with 14 additions and 12 deletions

View file

@ -30,7 +30,6 @@ async function init() {
assignedUserContextId, assignedUserContextId,
false false
); );
console.log(currentTab);
Utils.reloadInContainer( Utils.reloadInContainer(
currentTab.url, currentTab.url,
false, false,

View file

@ -854,26 +854,29 @@ Logic.registerPanel(P_CONTAINER_PICKER, {
}; };
break; break;
case REOPEN_IN_CONTAINER: case REOPEN_IN_CONTAINER:
pickedFunction = function (identity) { pickedFunction = async function (identity) {
try { const currentTab = await Utils.currentTab();
browser.tabs.create({ const newUserContextId = Utils.userContextId(identity.cookieStoreId);
cookieStoreId: identity.cookieStoreId console.log(currentTab);
}); Utils.reloadInContainer(
window.close(); currentTab.url,
} catch (e) { false,
window.close(); newUserContextId,
} currentTab.index + 1,
currentTab.active
);
window.close();
}; };
break; break;
case ALWAYS_OPEN_IN_PICKER: case ALWAYS_OPEN_IN_PICKER:
default: default:
pickedFunction = async function (identity) { pickedFunction = async function (identity) {
const userContextId = Utils.userContextId(identity.cookieStoreId);
const currentTab = await Utils.currentTab(); const currentTab = await Utils.currentTab();
const assignedUserContextId = Utils.userContextId(identity.cookieStoreId);
Utils.setOrRemoveAssignment( Utils.setOrRemoveAssignment(
currentTab.id, currentTab.id,
currentTab.url, currentTab.url,
userContextId, assignedUserContextId,
false false
); );
window.close(); window.close();