I have a internet project where users print a lot. So we add “print button” in every page.
It work’s fine in all browser, but google chrome.
This button just call “javacript:window.print”. But when pressed, chrome opens new tab “chrome://print” just like when CTRL+P is typed.
But with CTRL+P print preview is showed fine.
With “window.print” we get this message: “Print is unavailable because the page you were trying to print has been closed.“
How can I solve this?
Try to add a “return false;” to the button to prevent the default action. So it opens the new tab, but keep the old one at the previous state.