The MDN page on onbeforeprint
is marked as updated last Nov 14, 2013, and it says “no” for Chrome, Opera, and Safari, “(Yes)” for IE, and “6.0” for Firefox. This is consistent with the results of checking with the current Chrome (version 34) and the last Windows version (5.1.7) of Safari. No event is triggered on them, and in developer tools, no onbeforeprint
listener is shown under “Event Listeners” in developer tools when onbeforeprint
attribute is used.
There is a WebKit bug report from 2008 about lack of support to beforeprint
and afterprint
events, and there’s a suggested patch but also issues with it, and it does not seem to be making progress.
So the answer is “No.”
Cf. onbeforeprint and onafterprint is not working in Chrome and IE?
As regards to the possible followup question “What should I use instead, then?”, it should be posted as a new question, with sufficient details (including code) to describe the original problem – in particular, what would be the part that you cannot do by using a print stylesheet.