window.print() blocks AJAX calls
Reported by
ik99...@gmail.com,
Oct 17 2016
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 Steps to reproduce the problem: 1. Go to: http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_ajax 2. Paste: <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ $("#zzzz").submit(); $("button").click(function(){ $.ajax({url: "demo_test.txt", success: function(result){ $("#div1").html(result); }}); }); }); </script> </head> <body> <div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div> <form id="zzzz" method="get" target="_blank" action="/colors/default.asp"> <input type="hidden" value="0" /> </form> <button>Get External Content</button> </body> </html> 3. Click "Run" 4. New window will open. In this window press F12 and open Console 5. In Console enter "window.print();" and hit enter 6. Go back to original tab and click "Get External Content" also attempt to click "Run" - buttons are not working. 7.Go back to print preview tab and cancel print preview - now "Get External Content" and "Run" buttons are working fine. What is the expected behavior? "Get External Content" and "Run" buttons should work regardless of print preview page being open. What went wrong? Ajax requests are reporting "pending" status when print preview is open. Did this work before? N/A Chrome version: 54.0.2840.59 m (64-bit) Channel: n/a OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Shockwave Flash 23.0 r0
,
Oct 19 2016
This looks like a case of nested event loops not being supported on purpose. Sending to jochen to confirm and close the bug.
,
Oct 20 2016
Indeed, window.print() is a blocking call. The fact that we spin a message loop is an implementation detail, and is on purpose not accessible to web sites |
|||
►
Sign in to add a comment |
|||
Comment 1 by rbasuvula@chromium.org
, Oct 18 2016Labels: M-56 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)