Calling window.print() in a function fails to bring up the Safari native print window. This does however work in Chrome.
I've tried:
document.execCommand('print', false, null) occasionally works but 90% of the time will show a 100+ page document with no content in the print dialog.macOS 12.3, Safari 15.4, Nuxt 2.15.7
There seems to be two problems going on here:
window.print() in Nuxt does not bring up the Safari print window.As for the first problem, I found this bug report that an active EventSource prevents Safari from displaying the print window. So i thought hmmm, maybe the Nuxt dev server is somehow using this to communicate with the client. So I tried running my app in production mode (nuxt build && nuxt start) and voilà, this made my Safari print window appear as expected.