afterprint fired too early
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
People
(Reporter: eb, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36
Steps to reproduce:
window.addEventListener("afterprint", () => { console.log("afterprint")})
window.print()
Actual results:
"afterprint" event is fired immediately after the dialog opens.
This bug seems to have appeared around Firefox v83, it's reproduced on v88 and v89.
I personnaly use Ubuntu 20.04 with Firefox 88.
Related Stack overflow question: https://stackoverflow.com/questions/68154482/afterprint-event-on-firefox-89
Expected results:
From the documentation (https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onafterprint), it should be fired when the dialog is closed or the printing physically starts. This is needed to alter the style temporarily before print.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
Can you please try to use mozregression tool to find where it broke?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Use_Mozregression_tool
Thanks.
Comment 3•3 years ago
|
||
Dupe of bug 1663290. But we can fire afterprint earlier because printing clones the document. So all the temporary modifications that you make in beforeprint will make an effect and you can safely undo them in afterprint.
Description
•