Ignore non permissible urls when hiding as we can't open them which causes issues. Fixes #793
This commit is contained in:
parent
9b83068234
commit
ae79f0a303
2 changed files with 15 additions and 2 deletions
|
@ -63,8 +63,7 @@ const backgroundLogic = {
|
||||||
url = undefined;
|
url = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can't open these we just have to throw them away
|
if (!this.isPermissibleURL(url)) {
|
||||||
if (new URL(url).protocol === "about:") {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +75,17 @@ const backgroundLogic = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isPermissibleURL(url) {
|
||||||
|
const protocol = new URL(url).protocol;
|
||||||
|
// We can't open these we just have to throw them away
|
||||||
|
if (protocol === "about:"
|
||||||
|
|| protocol === "chrome:"
|
||||||
|
|| protocol === "moz-extension:") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
checkArgs(requiredArguments, options, methodName) {
|
checkArgs(requiredArguments, options, methodName) {
|
||||||
requiredArguments.forEach((argument) => {
|
requiredArguments.forEach((argument) => {
|
||||||
if (!(argument in options)) {
|
if (!(argument in options)) {
|
||||||
|
|
|
@ -41,6 +41,9 @@ const identityState = {
|
||||||
const tabsByContainer = await browser.tabs.query({cookieStoreId, windowId});
|
const tabsByContainer = await browser.tabs.query({cookieStoreId, windowId});
|
||||||
tabsByContainer.forEach((tab) => {
|
tabsByContainer.forEach((tab) => {
|
||||||
const tabObject = this._createTabObject(tab);
|
const tabObject = this._createTabObject(tab);
|
||||||
|
if (!backgroundLogic.isPermissibleURL(tab.url)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// This tab is going to be closed. Let's mark this tabObject as
|
// This tab is going to be closed. Let's mark this tabObject as
|
||||||
// non-active.
|
// non-active.
|
||||||
tabObject.active = false;
|
tabObject.active = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue