diff --git a/info.js b/info.js index baa82a1..90d908c 100644 --- a/info.js +++ b/info.js @@ -13,6 +13,7 @@ function checkHistory() { var getting = browser.storage.local.get("disable_history"); getting.then(got => { disable_history = got.disable_history; + if (disable_history == undefined) disable_history = false; console.log("checking history", disable_history); document.getElementById("disable-history").checked = disable_history; }); diff --git a/scrub.js b/scrub.js index 5476462..2053ca0 100644 --- a/scrub.js +++ b/scrub.js @@ -63,6 +63,8 @@ var contextScrub = async function(requestDetails) { let tabInfo = await browser.tabs.get(tabId); return tabInfo; } catch (error) { + let tabInfo = await browser.tabs.getCurrent(); + return tabInfo; console.log("(scrub)Context Error", error); } }; @@ -102,8 +104,10 @@ var contextSetup = async function(requestDetails) { if (tabId.cookieStoreId != context[0].cookieStoreId) { function Create(window) { function onCreated(tab) { - console.log("(isolate) Closing old, un-isolated tab", window); - if (tabId != undefined) browser.tabs.remove(tabId.id); + if (tabId != undefined) { + console.log("(isolate) Closing old, un-isolated tab"); + browser.tabs.remove(tabId.id); + } } var created = browser.tabs.create({ active: true, @@ -128,8 +132,10 @@ var contextSetup = async function(requestDetails) { if (tabId.cookieStoreId != context[0].cookieStoreId) { function Create(window) { function onCreated(tab) { - console.log("(isolate) Closing old, un-isolated tab"); - if (tabId != undefined) browser.tabs.remove(tabId.id); + if (tabId != undefined) { + console.log("(isolate) Closing old, un-isolated tab"); + browser.tabs.remove(tabId.id); + } } var created = browser.tabs.create({ active: true, @@ -154,8 +160,10 @@ var contextSetup = async function(requestDetails) { if (tabId.cookieStoreId != context[0].cookieStoreId) { function Create(window) { function onCreated(tab) { - console.log("(isolate) Closing old, un-isolated tab"); - if (tabId != undefined) browser.tabs.remove(tabId.id); + if (tabId != undefined) { + console.log("(isolate) Closing old, un-isolated tab"); + browser.tabs.remove(tabId.id); + } } var created = browser.tabs.create({ active: true, @@ -180,8 +188,10 @@ var contextSetup = async function(requestDetails) { if (tabId.cookieStoreId != context[0].cookieStoreId) { function Create(window) { function onCreated(tab) { - console.log("(isolate) Closing old, un-isolated tab"); - if (tabId != undefined) browser.tabs.remove(tabId.id); + if (tabId != undefined) { + console.log("(isolate) Closing old, un-isolated tab"); + browser.tabs.remove(tabId.id); + } } var created = browser.tabs.create({ active: true, @@ -206,8 +216,10 @@ var contextSetup = async function(requestDetails) { if (tabId.cookieStoreId != context[0].cookieStoreId) { function Create(window) { function onCreated(tab) { - console.log("(isolate) Closing old, un-isolated tab"); - if (tabId != undefined) browser.tabs.remove(tabId.id); + if (tabId != undefined) { + console.log("(isolate) Closing old, un-isolated tab"); + browser.tabs.remove(tabId.id); + } } var created = browser.tabs.create({ active: true, @@ -237,8 +249,10 @@ var contextSetup = async function(requestDetails) { if (tabId.cookieStoreId != context[0].cookieStoreId) { function Create(window) { function onCreated(tab) { - console.log("(isolate) Closing old, un-isolated tab"); - if (tabId != undefined) browser.tabs.remove(tabId.id); + if (tabId != undefined) { + console.log("(isolate) Closing old, un-isolated tab"); + browser.tabs.remove(tabId.id); + } } var created = browser.tabs.create({ active: true,