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,
false
);
console.log(currentTab);
Utils.reloadInContainer(
currentTab.url,
false,

View file

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