New issue
Advanced search Search tips

Issue 656656 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

window.print() blocks AJAX calls

Reported by ik99...@gmail.com, Oct 17 2016

Issue description

UserAgent: 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
 
Cc: rbasuvula@chromium.org
Labels: M-56 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Tested the issue on chrome Stable #54.0.2840.59, Canary 56.0.2891.0 in Windows 10.0 and was able to reproduce the issue.

This is a Non-Regression issue since seeing this from M35 #35.0.1898.0, Making the status to Untriaged so that the issue would get addressed.

Note : Able to reproduce the issue in MAC 10.12 and Linux Ubuntu 14.04.

Thank you.
Components: -Blink Internals>Printing
Owner: jochen@chromium.org
Status: Assigned (was: Untriaged)
This looks like a case of nested event loops not being supported on purpose.
Sending to jochen to confirm and close the bug.

Comment 3 by jochen@chromium.org, Oct 20 2016

Cc: thestig@chromium.org
Status: WontFix (was: Assigned)
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