Closed (duplicate)
Project:
Printer, email and PDF versions
Version:
6.x-1.12
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2010 at 12:50 UTC
Updated:
22 May 2012 at 10:32 UTC
Hi,
The window.print() dialog is not showing in Chrome (7.0.517.41). It appears fine in Firefox and IE 7 and 8.
I have tried running it (window.print()) from the Chrome console and that works. Perhaps there is a problem with "Drupal.behaviors.print = function(context) {window.print();}"?
I am using Drupal 6.19, and print 6.x-1.12.
Comments
Comment #1
peamik123 commentedI've just run up against the same problem in my test site, also using version 6.x-1.12. However, I have a live site still using version 6.x-1.10 which is exhibiting the same fault, so it doesn't seem to be something introuduced in 6.x-1.11 or 6.x-1.12.
I'm using Chrome 7.0.517.44, but am unable to say whether this has been working in the past. It works fine in all other browsers.
I do get a tab open up when I click print, and the print page appears very very briefly - nowhere near long enough to be able to read anything - then it closes again. Clearly some processing is being triggered, but I have no idea how to track this further.
Has anyone else found a solution to this problem yet?
Comment #2
peamik123 commentedMore info has come to hand since my earlier post.
Copying the link from the print icon & running that in a new tab works fine. The print dialogue appears.
Running the window.open('http://www.example.com/print/node/2394'); within the firebug console on Chrome also fires up the new tab, but still closes it down again before the print dialogue can appear. No errors are reported in the console.
A more experienced colleague of mine has suggested that perhaps there is a timing problem occurring. Maybe the new window needs to wait a bit before trying window.print().
I am hoping that this info will give someone else some ideas of how to resolve this problem.
Comment #3
ReMMeR commentedSome delay fixes the problem.
Fixed with this hack :
print.pages.inc
line 219
change original
to
Drupal.behaviors.print = functio n(context) {setTimeout(\"window.print();$window_close\",1000);}$print['sendtoprinter'] = $print_html_sendtoprinter ? "" : '';
i added 1 second delay (setTimeout ) for print and Crome now works fine.
Comment #4
jcnventuraComment #5
kristen polThe print window is not showing up for me in Firefox or Chrome. I tried added the setTimeout code above but it still doesn't show up for me. I'm on Linux so have not tried IE yet.
If I change the <body> to <body onload="window.print()"> then the print dialog does show up. This is where it used to be until the patch was committed from #696318: <body onload="window.print();"> blocks Drupal.behaviors.* functions from triggering before print: http://drupal.org/node/696318
Kristen
Comment #6
jcnventuraThe onload=window.print call will only show up when you configure that in admin/settings/print..
I've tested print + D6 + Chrome 9 + Ubuntu 10.10 and it worked fine for me.
Comment #7
jcnventuraThis seems to be a Chrome problem that was (as it should) be fixed in Chrome.
I'm unable to reproduce the problem as reported.
Comment #8
jcnventuraThis problem has reappeared, and a fix will be applied to dev soon.
See #1579870: Window open + print + close, has some issues in non-Firefox browsers