Bug 245171 - Afterprint event is fired before print dialog closed
Summary: Afterprint event is fired before print dialog closed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-09-14 01:41 PDT by Woody Lee
Modified: 2022-09-21 01:42 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Woody Lee 2022-09-14 01:41:29 PDT
The afterprint event should be fired after print dialog closed.
Ensure action executes after print, shuch as change some content or close window etc.

It only reproduces in iOS/iPadOS Safari, version 15.6 and 16.

Another question: window can't close while the print dialog shown, is it a standard interaction?
Comment 1 Ahmad Saleem 2022-09-14 04:05:17 PDT
Can you attach a test case to reproduce this issue? Thanks!
Comment 2 Woody Lee 2022-09-14 18:10:03 PDT
#c1
A simple example:

var win = window.open('');
win.document.write('<div>Test</div>');
win.addEventListener('afterprint', (e) => console.log(e) );
win.print();

The event log will fired before print dialog closed.
Comment 3 Radar WebKit Bug Importer 2022-09-21 01:42:19 PDT
<rdar://problem/100212895>