New issue
Advanced search Search tips

Issue 914019 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 912966
Owner: ----
Closed: Dec 11
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.

Regards,
Visruth
 
test1.html
527 bytes View Download
test2.html
388 bytes View Download
Mergedinto: 912966
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment