Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

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

Latest_Git_snapshot
fixed
1
2013-12-27
2006-02-14
Ryan Schmidt
No

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 1.5.0.1 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.

Discussion

  • Isaac Bennetch
    Isaac Bennetch
    2006-02-17

    Logged In: YES
    user_id=835650

    Possibly a duplicate of 1419696
    (http://sourceforge.net/tracker/index.php?func=detail&aid=1419696&group_id=23067&atid=377408)
    ?

    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
    user_id=326580

    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
    user_id=326580

    @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
    2006-02-20

    Logged In: YES
    user_id=838923

    @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
    user_id=326580

    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
    2006-03-06

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

    • Status: closed-fixed --> fixed