save confirm page url to the local storage as a backup

This commit is contained in:
Oksana Melnik 2019-11-03 09:30:37 +01:00
parent f159e42029
commit 741385738b
2 changed files with 10 additions and 1 deletions

View file

@ -490,6 +490,8 @@ const assignManager = {
currentCookieStoreId = backgroundLogic.cookieStoreId(currentUserContextId);
confirmUrl += `&currentCookieStoreId=${currentCookieStoreId}`;
}
browser.storage.local.set({ "confirmUrl": confirmUrl});
browser.tabs.create({
url: confirmUrl,
cookieStoreId: currentCookieStoreId,

View file

@ -1,5 +1,12 @@
async function load() {
const searchParams = new URL(window.location).searchParams;
let searchParams = new URL(window.location).searchParams;
if (!searchParams.get("url")) {
const savedUrl = await browser.storage.local.get("confirmUrl");
searchParams = new URL(savedUrl.confirmUrl).searchParams;
}
const redirectUrl = searchParams.get("url");
const cookieStoreId = searchParams.get("cookieStoreId");
const currentCookieStoreId = searchParams.get("currentCookieStoreId");