Created attachment 448847 [details] Simple proof of concept to highlight the issue. Programmatically printing a PDF from an iframe result in a blank page. You can find an archive attached to this message, on which you can run a web server to reproduce the issue. If a `setTimeout` is set (1000ms in the attached example) before the call to `print()`, the first attempt works (see `working-print.png` in the attached archive) However if we click on "cancel", successive attempts result in a blank page, after asking "This web page is trying to print. Do you want to print this web page?". (See `failed-print.png` in the attached archive). So far I have only reproduced the bug on Safari. I have tested it on last versions of Firefox (95) and Chrome (97) without the bug happening. It seems that the bug has been introduced in a recent version of Safari, as it used to work before.
<rdar://problem/87464058>