"…because you need to press enter" is something which was set on purpose, otherwise the behavior would be
prohibitively intrusive. As JavaScript is most typically stored on the server side, and executed on the client side, it can be anything. That's why JavaScript implementation in browsers is
focused on safety — no potentially dangerous access to the local system is allowed.
After all, no one would like printing something without the user concern. If you could do what you want, I would consider it as a crime against me. The computer and printer is mine, no Web application is supposed to decide form me when to press Enter. So, leave it with
window.print();
better yest, allow the users to print any page they choose to pay using the browser menu.
For the bonus: there is one aspect of it: you can render the same content for printing differently from screen rendering. You have have different CSS styles depending the media using CSS
@media
:
http://www.w3.org/TR/CSS21/media.html[
^].
—SA