Chrome used to open a seperate window containing just the element i wanted printed and its relative css. That window then spawned the .print command which opened another window containing print preview.
Now Chrome no longer opens a new window for their print preview. Instead it opens a “dialog with overlay” in the current page to be printed.
So if you use
to print the current page, the window will close and nothing will be printed.
For some reason Chrome don’t start the timeout timer until the print dialog is closed.
what we can do is:
basically seTimeout is called only when the document is focused which happens only when the overlay print dialog is closed.