Issue metadata
Sign in to add a comment
|
onbeforeprint and onafterprint is not getting invoked when window.print() is called
Reported by
visrut...@gmail.com,
Dec 11
|
||||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36 Steps to reproduce the problem: Procedure1 1. Open test1.html 2. Click on any button eg: "Button1 to hide on print" 3. We can see neither onbeforeprint nor onafterprint is invoked Procedure2 1. Open test2.html 2. Click on "Button1 to hide on print" 3. We can see neither onbeforeprint nor onafterprint is invoked What is the expected behavior? The onbeforeprint must be invoked before print and onafterprint must be invoked after print i.e. the clicked button must be hidden in the print preview and visible when the preview is cancelled. What went wrong? neither onbeforeprint nor onafterprint is invoked so the clicked button is visible in the print preview. Did this work before? N/A Chrome version: 71.0.3578.80 Channel: stable OS Version: CentOS7 Flash Version: In the previous version of chrome it was working fine. Due to this behaviour, I'm unable to solve this issue reported in https://bugs.chromium.org/p/chromium/issues/detail?id=904447. When the onbeforeprint & onafterprint is used as an inline attribute in the body tag and if the CTRL + P is pressed then they are getting invoked.
,
Dec 12
,
Dec 12
Thanks for filing the issue! Able to reproduce the issue on reported chrome version 71.0.3578.80 and on the latest canary 73.0.3637.0 using Ubuntu 14.04 Note: Issue isn't seen on Mac 10.14.1 and Windows 10 As the issue is seen from M60(60.0.3112.0) considering it as Non-Regression and marking it as Untriaged.
,
Dec 12
I also have this issue with Mac OS 10.14 (Mojave) and Chrome version 71.0.3578.80 (wasn't happening in Chrome 70). Also, I think this has being happening also in some recent versions of Chrome Canary (since ~69 I think).
I use window.matchMedia('print') to detect before/after print events and it doesn't work either if I call window.print(). However, if I use cmd+P the listener of matchMedia fires correctly.
,
Dec 12
Issue is occurring on Windows 10 Pro Build 17134.407 Chrome version 71.0.3578.80
,
Dec 12
,
Dec 14
window.onbeforeprint is being called now with window.print(), but window.matchMedia('print') is still not working in new version 71.0.3578.98.
,
Dec 14
That was privately reported as bug 914554 yesterday, and r616279 is the fix. If you try Chrome Canary 73.0.3640.0 or newer in a day or two, that should have the fix. We are waiting for the fix to at least ship to Canary channel and some feedback, before considering merging the fix to M71 and M72.
,
Dec 14
Ok! I'll wait then. Thank you!
,
Dec 14
73.0.3640.0 is available on Canary channel now.
,
Dec 14
... and someone already confirmed the fix on bug 914800 . |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by nathanie...@gmail.com
, Dec 11