#2015 (ok 2.8.0-beta2) Safari: Print view prints blank page

Ryan Schmidt

I had never tried the "Print view" link at the bottom of a
result set, but I tried it now in Safari 2.0.2 and noticed
that it prints a blank page.* I guess the reason is that
you call the JavaScript print() function in a script at
the bottom of the page, but at that point the browser
hasn't finished rendering the table, and so it prints what
it has so far (which is nothing).

--> I believe the solution would be to call the print()
function through the onload handler instead. (<body
onload="if (typeof(window.print) != 'undefined')
window.print();">) <--

* In Firefox it works fine.

I tested the phpMyAdmin-20060213-053501 CVS snapshot with
PHP 5.1.2, MySQL 5.0.18 and Lighttpd 1.4.10 on Mac OS X
10.4.4 PPC.


  • Isaac Bennetch
    Isaac Bennetch

    Logged In: YES

    Possibly a duplicate of 1419696

    The user there (rkanters) seems to have fixed it by adding a
    #color line to theme_print.css.php...but since I don't have
    access to Safari I can't confirm that it's even the same
    problem (Darn you, MacBook Pro - drop in price quicker!)

  • Logged In: YES

    But you cant click the button if the browser hasnt finished
    to render the page!?

    pls check CVS if it still happens (fixed bug #1419696)

  • Logged In: YES

    @Ryan Schmidt: can you please check CVS if the problem still
    exists? and possbile booth HEAD and QA_2_8? Thanks!

    • status: open --> open-accepted
  • Ryan Schmidt
    Ryan Schmidt

    Logged In: YES

    @cybot_tm ("But you cant click the button if the browser
    hasnt finished to render the page!?"): There is no button.
    If you're looking at a PMA query result, then you can
    scroll down and click the link labeled "Print view." This
    opens a new window. The HTML code in the new window ends
    with a script tag which automatically calls the window's
    print() function. Unfortunately, Safari has not finished
    rendering the page by the time this function is called,
    hence an empty page is printed. Other browsers presumably
    finish rendering the table immediately after the closing
    table tag and before the opening script tag. I believe
    I've read however that Safari spawns a separate rendering
    thread, so the renderer is still in progress while the
    parser has already encountered the script tag. The
    solution as I mentioned earlier is to call the print()
    function from the page's onload handler, which is
    guaranteed in all browsers not to be called until the page
    has finished rendering; it is, in fact, the onload
    handler's purpose, so it should be used for that.

    I just tested CVS HEAD right now and the situation is
    unchanged. I do not know enough about CVS to know
    how to test QA_2_8.

  • Logged In: YES

    added window.onload handler, should work now

    • priority: 5 --> 1
    • assigned_to: nobody --> cybot_tm
    • summary: Safari: Print view prints blank page --> (ok 2.8.0-beta2) Safari: Print view prints blank page
    • status: open-accepted --> open-fixed
  • Marc Delisle
    Marc Delisle

    • status: open-fixed --> closed-fixed
  • Michal Čihař
    Michal Čihař

    • Status: closed-fixed --> fixed