Issue 178931 in chromium: Print dialog stops all javascript

166 views
Skip to first unread message

chro...@googlecode.com

unread,
Feb 27, 2013, 9:15:01 PM2/27/13
to chromi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Area-Compat Pri-2 Via-Wizard Type-Bug OS-Windows

New issue 178931 by ch...@sillevis.net: Print dialog stops all javascript
http://code.google.com/p/chromium/issues/detail?id=178931

UserAgent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101
Firefox/19.0

Example URL:

Steps to reproduce the problem:
1. Run a socket.io server and client. Ping connections
2. Press cmd/ctrl+p
3. No more pings

What is the expected behavior?
The print dialog should not kill all javascript on the page. This is the
case with Chrome running WITH and WITHOUT --disable-print-preview or
--kiosk-printing

What went wrong?
Our web connected POS software is trying to keep everything in sync, when a
client tries to print a receipt, sometimes they miss the "Print" button,
and the dialog hides behind the screen (they are using touch only, no
keyboard, and are in --kiosk) effectively killing our web app without
giving a clue to the client what happened (the print dialog is still open
in the background stopping everything).

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No

Did this work before? No

Does this work in other browsers? No

Chrome version: 26.0.1410.12 Channel: stable
OS Version: 6.2 (Windows 8)

Possible fix would be to have --kiosk-printing automatically get the same
printing settings as without (the printed receipts come out twice as long
with this setting enabled), or not allowing print dialogs to hide behind
the screen.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Feb 28, 2013, 8:02:40 PM2/28/13
to chromi...@chromium.org

Comment #3 on issue 178931 by ch...@sillevis.net: Print dialog stops all
javascript
http://code.google.com/p/chromium/issues/detail?id=178931

> Are you printing using the system print dialog, or the print preview in
> Chrome?
Sorry, allow me to clarify:

* Printing using the system print dialog (--disable-print-preview) creates
the issues where the print dialog hides behind the (--kiosk) screen
preventing access to the page (whether JS is blocked or not).

* Behaviour when not adding --disable-print-preview is such that the
receipt being printed ends up twice as big (this is a seperate bug, which I
won't try and pursue here).

> Also, could you verify which channel you're on? M26 should not be stable
> yet.
Sorry about M26, it's the latest Windows stable (25 something).

> Lastly, if you have any example page (w/HTML/JS) that is affected by this
> issue, please attach it to the bug.
I will have to recreate a page which replicates the bug, as it is behind a
login. Give me some time and I will get to it.



> Are you actually pressing ctrl+p or using window.print()? I wrote a
> simple page that does window.setInterval(window.alert('hi')),timeout);
> and it continues to fire even with the print preview dialog open.
It's a window.print(); This is the exact code (var printCSS has the HTML):


// Create printer popup
var w =
window.open( '', '', 'width=260,height=600,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no'
)
w.document.write( '<html><head><style type="text/css">' + printCSS
+ '</style><title> </title></head><body style="margin: 0px; padding:
0px;">' + rcpt.html() + '<script>setTimeout(function(){ window.print();
window.parent.focus(); window.close() }, 100)</script></body></html>' )


> Can you explain more about what you are trying to do? Are you using
> --kiosk ? --kiosk-printing? I don't understand what you mean by "the
> dialog hides behind the screen". With print preview, the print dialog
> cannot go underneath the tab it's in.
--kiosk and --disable-print-preview, for some clients we have enabled
--kiosk-printing because of this bug, but it produces twice as long
receipts (because --disable-print-preview is ignored when --kiosk-printing
is enabled - it will use Chrome's dialog to auto-click).

chro...@googlecode.com

unread,
Feb 28, 2013, 8:13:40 PM2/28/13
to chromi...@chromium.org

Comment #4 on issue 178931 by ch...@sillevis.net: Print dialog stops all
javascript
http://code.google.com/p/chromium/issues/detail?id=178931

The exact version is: 25.0.1364.97 m

chro...@googlecode.com

unread,
Feb 28, 2013, 8:25:40 PM2/28/13
to chromi...@chromium.org

Comment #5 on issue 178931 by ch...@sillevis.net: Print dialog stops all
javascript
http://code.google.com/p/chromium/issues/detail?id=178931

Sorry for spamming you guys, wanted to share that this bug might have
something to do with my issue (the JS hanging/reloading issue):
https://code.google.com/p/chromium/issues/detail?id=128012&q=label%3AFeature-Printing&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20OS%20Area%20Feature%20Status%20Owner%20Summary

chro...@googlecode.com

unread,
Feb 28, 2013, 8:57:40 PM2/28/13
to chromi...@chromium.org
Updates:
Status: WontFix
Labels: -Action-FeedbackNeeded

Comment #6 on issue 178931 by the...@chromium.org: Print dialog stops all
javascript
http://code.google.com/p/chromium/issues/detail?id=178931

Sounds like you have a variety of issues. Since you are using
window.print(), you should be aware window.print() is synchronous. Until
the print dialog closes, basically nothing else happens Javascript-wise. So
this is working as intended.

What's the bug # for the receipts being twice as long? That seems like
something we should fix.

chro...@googlecode.com

unread,
Feb 28, 2013, 9:01:40 PM2/28/13
to chromi...@chromium.org

Comment #7 on issue 178931 by ch...@sillevis.net: Print dialog stops all
javascript
http://code.google.com/p/chromium/issues/detail?id=178931

Ah, gotcha. What else could or should we use to go around that? Is there
anything? We are already opening it in a new window to try and avoid the
problem.. Should we not do that?

I haven't created a bug yet for the long printing, because the only (debug)
information I have so far is that if we use the system dialog, we get a
normal receipt (WITH --disable-print-preview).

If we use the chrome dialog, we get either a receipt going on forever
(seems completely zoomed out - this is with certain printers) or a receipt
twice the length (WITH --kiosk-printing).

Wish I had more information, but that's it. Using either CITIZEN thermal
printers, or any next USB/IP thermal printer. Must have something to do
with the different defined sizes. It's been happening for the past four
months.

chro...@googlecode.com

unread,
Feb 28, 2013, 9:30:41 PM2/28/13
to chromi...@chromium.org

Comment #8 on issue 178931 by the...@chromium.org: Print dialog stops all
javascript
http://code.google.com/p/chromium/issues/detail?id=178931

We have had issues where printing with the print preview dialog and
printing with the system print dialog generated different results. In fact,
a while back, someone else had a similar issue with their receipt printers.
Please file a new bug with a sample file that demonstrates the issue.

With window.open(), the new window and the parent window are still in the
same renderer. Thus you can do things like w.document.write(). But it also
means once window.print() effectively hangs the renderer, all windows/tabs
in that renderer hangs.

My opinion is to use --kiosk-printing, which would immediately close the
print dialog. Also, keep filing bugs for features you need, or contribute
code to Chromium until kiosk printing supports your needs.

chro...@googlecode.com

unread,
Mar 5, 2014, 11:19:26 PM3/5/14
to chromi...@chromium.org

Comment #10 on issue 178931 by vitalyb...@chromium.org: Print dialog stops
all javascript
http://code.google.com/p/chromium/issues/detail?id=178931

Issue 349103 has been merged into this issue.

chro...@googlecode.com

unread,
Apr 27, 2014, 11:56:40 PM4/27/14
to chromi...@chromium.org

Comment #11 on issue 178931 by kiera...@geoop.com: Print dialog stops all
javascript
http://code.google.com/p/chromium/issues/detail?id=178931

I have encountered a similar issue using windows.print() when opening a new
window from the parent.

When closing the child window without cancelling the print dialog in the
child, the parent window is still blocked from using javascript.

chro...@googlecode.com

unread,
May 13, 2014, 3:31:07 PM5/13/14
to chromi...@chromium.org

Comment #13 on issue 178931 by vitalyb...@chromium.org: Print dialog stops
all javascript
http://code.google.com/p/chromium/issues/detail?id=178931

re #11, #12: You are describing Issue 359627

chro...@googlecode.com

unread,
Aug 31, 2015, 11:36:05 AM8/31/15
to chromi...@chromium.org

Comment #14 on issue 178931 by falk.pau...@gmail.com: Print dialog stops
all javascript
https://code.google.com/p/chromium/issues/detail?id=178931

Is there a work-around for this that keeps the leaves the opener unblocked
when doing synchronous operarations in the popup?

chro...@googlecode.com

unread,
Aug 31, 2015, 11:40:05 AM8/31/15
to chromi...@chromium.org

Comment #15 on issue 178931 by falk.pau...@gmail.com: Print dialog stops
all javascript
https://code.google.com/p/chromium/issues/detail?id=178931

Wontfix? What is the work-around for this? This is a major blocker for all
single-page applications...

chro...@googlecode.com

unread,
Sep 7, 2015, 10:50:49 AM9/7/15
to chromi...@chromium.org

Comment #16 on issue 178931 by bmeyerko...@gmail.com: Print dialog stops
all javascript
https://code.google.com/p/chromium/issues/detail?id=178931

Are you serious?
Like Falk Paul said, this is really a show stopper for all single page
applications.

What about Long-Polling and Websocket connections?
Reply all
Reply to author
Forward
0 new messages