[TabGuard] Check for chains of about:blank puppet tabs.
This commit is contained in:
parent
327c3e19ea
commit
73da318de5
|
@ -162,12 +162,15 @@ var TabGuard = (() => {
|
||||||
}
|
}
|
||||||
// If it's about:blank and it has got an opener, let's assume the opener
|
// If it's about:blank and it has got an opener, let's assume the opener
|
||||||
// is the real origin and it's using the empty tab to run scripts.
|
// is the real origin and it's using the empty tab to run scripts.
|
||||||
if (tab.url === "about:blank") {
|
while (tab.url === "about:blank") {
|
||||||
if (tab.openerTabId > 0) {
|
if (!tab.openerTabId) {
|
||||||
let openerTab = TabCache.get(tab.openerTabId);
|
break;
|
||||||
|
}
|
||||||
|
const openerTab = TabCache.get(tab.openerTabId);
|
||||||
if (openerTab) {
|
if (openerTab) {
|
||||||
tab.url = openerTab.url;
|
tab.url = openerTab.url;
|
||||||
}
|
} else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tab.url !== "about:blank") {
|
if (tab.url !== "about:blank") {
|
||||||
|
|
Loading…
Reference in New Issue