WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
136335
window.print() is blocked until XMLHttpRequest completes
https://bugs.webkit.org/show_bug.cgi?id=136335
Summary
window.print() is blocked until XMLHttpRequest completes
Andrew Paprotsky
Reported
2014-08-28 03:09:48 PDT
If there's an active XMLHttpRequest window.print() is blocked; print dialog appears only when the request is completed. This is a problem for cases when XMLHttpRequest is used for long-polling. Steps to reproduce: 1. Extract the attached archive to a PHP enabled web server 2. Visit the index.php. 3. Click the button to see the result.
Attachments
reproducible test case
(807 bytes, application/zip)
2014-08-28 03:11 PDT
,
Andrew Paprotsky
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Andrew Paprotsky
Comment 1
2014-08-28 03:11:03 PDT
Created
attachment 237302
[details]
reproducible test case
Alexey Proskuryakov
Comment 2
2014-08-28 13:19:15 PDT
Thank you for the bug report. I think that this is unintentional (and a consequence of delaying a print() that's called from an inline script), yet this still looks like a correct behavior. If XHR progress events were displayed under a modal print dialog, that would cause many undesirable effects (e.g. what if event handler tried to do a window.close() while the window was being printed). And if we stopped progress events, that would cause correctness issues on websites that expect them to be handled in a timely manner.
Andrew Paprotsky
Comment 3
2014-08-28 23:04:20 PDT
Thanks for the quick reply. The problem is that if I want to print something using window.print() then I have to wait until active XHR is completed. So if I have a long-polling request with 10 minutes timeout then in worst case I'd have to wait 10 minutes until the print dialog appears.
Philipp Spiess
Comment 4
2017-10-16 09:51:02 PDT
This is still an issue. Chrome seems to have fixed this [1], are there any plans for Safari to do the same as well? This makes it impossible to use the print API for websites that rely on long-polling to get real time updates. [1]
https://bugs.chromium.org/p/chromium/issues/detail?id=173140
Radar WebKit Bug Importer
Comment 5
2017-10-17 12:25:46 PDT
<
rdar://problem/35035119
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug