From f8d99c8fca960b90a7af9bc1d981d6a1ca0c1b29 Mon Sep 17 00:00:00 2001 From: idk Date: Mon, 2 Mar 2020 17:34:39 -0500 Subject: [PATCH] Fix other containerizers --- scrub.js | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/scrub.js b/scrub.js index 65853db..de0fc4d 100644 --- a/scrub.js +++ b/scrub.js @@ -87,6 +87,45 @@ var contextScrub = async function(requestDetails) { } }; +var notMyContextNotMyProblem = async function(){ + var contexts = await browser.contextualIdentities.query({}) + var context1 = await browser.contextualIdentities.query({ + name: titlepref + }); + var context2 = await browser.contextualIdentities.query({ + name: routerpref + }); + var context3 = await browser.contextualIdentities.query({ + name: mailpref + }); + var context4 = await browser.contextualIdentities.query({ + name: torrentpref + }); + var context5 = await browser.contextualIdentities.query({ + name: tunnelpref + }); + var context6 = await browser.contextualIdentities.query({ + name: localpref + }); + var othercontexts = [] + console.log("Contexts:", contexts) + for (context in contexts) { + if (contexts[context].cookieStoreId == context1[0].cookieStoreId || + contexts[context].cookieStoreId == context2[0].cookieStoreId || + contexts[context].cookieStoreId == context3[0].cookieStoreId || + contexts[context].cookieStoreId == context4[0].cookieStoreId || + contexts[context].cookieStoreId == context5[0].cookieStoreId || + contexts[context].cookieStoreId == context6[0].cookieStoreId + ){ + console.log("Context found", contexts[context].cookieStoreId, "is my responsibility") + }else{ + //console.log("Context found", contexts[context].cookieStoreId, "is not my responsibility") + othercontexts.push(contexts[context]) + } + } + return othercontexts +} + var contextSetup = function(requestDetails) { function onContextError() { console.log("Context launcher error"); @@ -307,11 +346,20 @@ var contextSetup = function(requestDetails) { var localcontext = await browser.contextualIdentities.query({ name: localpref }); + var othercontexts = await notMyContextNotMyProblem(); + var nmp = false; + for (context in othercontexts){ + if (tabId.cookieStoreId == othercontexts[context].cookieStoreId) { + console.log("Not my problem") + nmp = true + } + } if ( tabId.cookieStoreId == "firefox-default" || tabId.cookieStoreId == "firefox-private" || tabId.cookieStoreId == anoncontext[0].cookieStoreId || - tabId.cookieStoreId == localcontext[0].cookieStoreId + tabId.cookieStoreId == localcontext[0].cookieStoreId || + nmp ) { console.log( "(ISOLATE)",