exit router console tabs when leaving the router console

This commit is contained in:
idk
2020-02-25 15:19:15 -05:00
parent 1de2a9e1c6
commit 5fbd32e6eb
2 changed files with 34 additions and 25 deletions

View File

@@ -260,6 +260,9 @@ fmt:
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes home.html > .home.html; mv .home.html home.html
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes toopie.html > .toopie.html; mv .toopie.html toopie.html
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes options/options.html > options/.options.html; mv options/.options.html options/options.html
make fmt-js
fmt-js:
find . -path ./node_modules -prune -o -name '*.js' -exec prettier --write {} \;
find . -path ./node_modules -prune -o -name '*.json' -exec prettier --write {} \;

View File

@@ -291,40 +291,43 @@ var contextSetup = function(requestDetails) {
console.log("(isolate)Context Error", error);
}
};
var anyTabFind = async function(tabId) {
var normalTabFind = async function(tabId) {
try {
var context = await browser.contextualIdentities.query({
name: webpref
var anoncontext = await browser.contextualIdentities.query({
name: titlepref
});
var localcontext = await browser.contextualIdentities.query({
name: localpref
});
console.log("(ISOLATE)", tabId.cookieStoreId);
if (
tabId.cookieStoreId == "firefox-default" ||
tabId.cookieStoreId == "firefox-private"
tabId.cookieStoreId != "firefox-default" ||
tabId.cookieStoreId != "firefox-private" ||
tabId.cookieStoreId != anoncontext[0].cookieStoreId ||
tabId.cookieStoreId != localcontext[0].cookieStoreId
) {
if (tabId.cookieStoreId != context[0].cookieStoreId) {
function Create() {
function onCreated(tab) {
function closeOldTab() {
if (tabId.id != tab.id) {
console.log("(isolate) Closing un-isolated tab", tabId.id);
console.log("in favor of", tab.id);
console.log("with context", tab.cookieStoreId);
browser.tabs.remove(tabId.id);
}
function Create() {
function onCreated(tab) {
function closeOldTab() {
if (tabId.id != tab.id) {
console.log("(isolate) Closing un-isolated tab", tabId.id);
console.log("in favor of", tab.id);
console.log("with context", tab.cookieStoreId);
browser.tabs.remove(tabId.id);
}
closeOldTab(tab);
}
var created = browser.tabs.create({
active: true,
cookieStoreId: context[0].cookieStoreId,
url: requestDetails.url
});
created.then(onCreated, onContextError);
closeOldTab(tab);
}
var gettab = browser.tabs.get(tabId.id);
gettab.then(Create, onContextError);
return tabId;
var created = browser.tabs.create({
active: true,
cookieStoreId: "firefox-default",
url: requestDetails.url
});
created.then(onCreated, onContextError);
}
var gettab = browser.tabs.get(tabId.id);
gettab.then(Create, onContextError);
return tabId;
}
} catch (error) {
console.log("(isolate)Context Error", error);
@@ -373,6 +376,9 @@ var contextSetup = function(requestDetails) {
if (localhost) {
var localtab = tab.then(localTabFind, onContextError);
return requestDetails;
} else {
//var normalTab = tab.then(normalTabFind, onContextError)
return requestDetails;
}
}
if (routerhost) {