Bug: Pop-up print window is blocked for on-the-fly iframes (version 3.18, 3.18.1)
Posted: Sat Jul 29, 2023 12:54 am
Print-function on the main-site works, but with the version 3.18 on we can't print a generated on-the-fly iframe anymore. That had still worked with version 3.17.
Deactivating AdBlock-Plus for the current website isn't enough, the only way to come around this issues is to deactivate AdBlock-Plus completely via chrome://extensions/.
For a better understanding I have written a small test-site. The first print-Button uses an iframe which exists from the beginning. The second print-Button creates an iframe-element on the fly.
The first button works fine. The second button only works, when ad-block plus is completely deactivated.
<Html>
<body>
<script>
function printIt() {
window.frames.printf.document.write("Hello there 1!")
window.frames.printf.print();
}
function printIt2() {
if(!window.frames.printf2) {
var element = document.createElement("iframe");
element.id = "printf2";
element.name = "printf2";
document.body.appendChild(element);
element.contentDocument.write("Hello there 2!");
}
window.frames.printf2.print();
}
</script>
</body>
<iframe id="printf" name="printf"></iframe>
<button onclick="printIt()">PrintIt</button>
<button onclick="printIt2()">PrintIt</button>
</html>
Can also be seen directly here: http://www.demawi.de/testiframe.html
Deactivating AdBlock-Plus for the current website isn't enough, the only way to come around this issues is to deactivate AdBlock-Plus completely via chrome://extensions/.
For a better understanding I have written a small test-site. The first print-Button uses an iframe which exists from the beginning. The second print-Button creates an iframe-element on the fly.
The first button works fine. The second button only works, when ad-block plus is completely deactivated.
<Html>
<body>
<script>
function printIt() {
window.frames.printf.document.write("Hello there 1!")
window.frames.printf.print();
}
function printIt2() {
if(!window.frames.printf2) {
var element = document.createElement("iframe");
element.id = "printf2";
element.name = "printf2";
document.body.appendChild(element);
element.contentDocument.write("Hello there 2!");
}
window.frames.printf2.print();
}
</script>
</body>
<iframe id="printf" name="printf"></iframe>
<button onclick="printIt()">PrintIt</button>
<button onclick="printIt2()">PrintIt</button>
</html>
Can also be seen directly here: http://www.demawi.de/testiframe.html