Mikael Berntsson
Mikael Berntsson

Reputation: 35

WindowObject.print() freeze in Chrome

I´m trying to print some content from a page. The page grabs some values from itself and builds a string that eventualy goes into an windowObject.

Problem happens when the user close the print dialog by hitting X in the corner of the print dialog. This will cause the main window (tab) to freeze. It works fine if the user prints the page or hit cancel on the dialog. Also works fine for me in FF.

Fiddle: http://jsfiddle.net/atgardmedia/9Pkyv/9/

var strHtml = "<html>\n<head></head><body>Content goes here..</body>\n</html>";

WindowObject = window.open('', 'PrintWindow', 'width=750,height=650,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes');

WindowObject.document.writeln(strHtml);
WindowObject.print();
WindowObject.close();

Any ideas?

Upvotes: 1

Views: 1414

Answers (1)

Sebastian
Sebastian

Reputation: 8005

This is a bug in Chrome that will be fixed in Chrome 36 according to the ticket.

Upvotes: 2

Related Questions