New issue
Advanced search Search tips

Issue 914018 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 912966
Owner: ----
Closed: Dec 12
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



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 description

UserAgent: 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.
 
test1.html
527 bytes View Download
test2.html
388 bytes View Download
Also experiencing the issue in Windows based OS.
Labels: Needs-Triage-M71
Cc: vamshi.kommuri@chromium.org
Components: UI>Browser>PrintPreview
Labels: Triaged-ET Target-73 M-73 FoundIn-71 FoundIn-73 FoundIn-72
Status: Untriaged (was: Unconfirmed)
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. 


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.
Issue is occurring on Windows 10 Pro Build 17134.407  
Chrome version 71.0.3578.80  

Mergedinto: 912966
Status: Duplicate (was: Untriaged)
71.0.3578.98 will roll out soon with the fix.
window.onbeforeprint is being called now with window.print(), but window.matchMedia('print') is still not working in new version 71.0.3578.98.
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.
Ok! I'll wait then. Thank you!
73.0.3640.0 is available on Canary channel now.
... and someone already confirmed the fix on  bug 914800 .

Sign in to add a comment