Window.print() Doesn't Work in Safari When Viewing PDFs
Using `window.print()` in Safari when viewing a PDF does not bring up the print dialog and it causes the browser tab to freeze.
The behaviour only seems to exist in specific versions of Safari.
Steps to Reproduce:
- Open any PDF in Safari (eg. https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf)
- Open console and enter window.print() or document.execCommand('print', false, null);
- No print dialog is displayed and the browser tab now seems to freeze (eg. PDF contents don't react to window resizing).
It feels like Safari thinks the print dialog is open and is blocking the thread, but nothing shows up visually.
Safari Version: 14.1.1 (16611.2.7.1.4)
macOS Version: Big Sur (11.4)
MacBook Pro 16″, macOS 11.4