window.print() or document.execCommand('print', false, null) using twice shows alert message
When using window.print() or document.execCommand('print', false, null) using javascript it shows alert message "This webpage is trying to print. Do you want to print this webpage?"
Steps to reproduce.
1) enter window.print() in console.
2) when print dialog opens. Select cancel.
3) enter window.print() again in console.
Safari thinks printing is still going on and displays alert message. See attached screenshot.
Note: If you select "print" and continue print. It doesn't display message.
Safari version: Version 15.3 (16612.4.9.1.8, 16612)
macOS version Big Sur: 11.6 (20G165)
MacBook Pro (2020 and later)