diff --git a/lib/check.js b/lib/check.js index 8e77058..aae80d9 100644 --- a/lib/check.js +++ b/lib/check.js @@ -52,7 +52,7 @@ logging.message("check url %s for block mode %s", url, blockMode); switch (url.protocol){ case "about:": - if (url.href === "about:blank"){ + if (url.pathname === "blank"){ logging.message("use regular mode on about:blank"); break; } diff --git a/releaseNotes.txt b/releaseNotes.txt index a39a213..75a10db 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -6,7 +6,7 @@ Version 1.10: - fixes: - - + - always protect about:blank known issues: - if a data URL is blocked the page action button does not appear diff --git a/test/iframeAPI.js b/test/iframeAPI.js index 5b6e9fe..f521891 100644 --- a/test/iframeAPI.js +++ b/test/iframeAPI.js @@ -86,9 +86,28 @@ const iframeAPI = function(){ } }, { - name: "window.open", + name: "removed iframe", prepare: async function openWindow(){ - const newWindow = window.open("/"); + const iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + const iframeWindow = iframe.contentWindow; + document.body.removeChild(iframe); + console.log("window of iframe directly after removing", iframeWindow); + return new Promise(function(resolve){ + window.setTimeout(function(){ + console.log("window of iframe in timeout", iframeWindow); + resolve(iframeWindow); + }, 1000); + }); + } + }, + ]; + + ["/", "about:blank", "about:blank#"].forEach(function(url){ + methods.push({ + name: "window.open " + url, + prepare: async function openWindow(){ + const newWindow = window.open(url); if (newWindow){ return { window: newWindow, @@ -106,11 +125,12 @@ const iframeAPI = function(){ }); } } - } - ]; + }); + }); function getPerformer(callback){ return async function perform(method){ + console.log("run iframe method", method.name); const api = await method.prepare(); callback(api.window, method.name); api.cleanup();