NEW 16143
Window locations are invalid when generated from "onunload" event
https://bugs.webkit.org/show_bug.cgi?id=16143
Summary Window locations are invalid when generated from "onunload" event
dale jensen
Reported 2007-11-26 10:14:00 PST
I'm working on a function to save and restore window positions, and am running into a snag. I have a function in the base of window "A" that opens window "B" and also has a function that receives a message back from the popup. To wit: Window "A": function saveWindowLocation(windX, windY) { alert(windX + ', ' + windY); } Window "B": function saveWindowLocation(windowName) { windX = window.screenX; windY = window.screenY; opener.top.saveWindowLocation(windX, windY); } ( and ) <body onunload="saveWindowLocation('mywindow');"> -=-=-=- That seems, to me, to be the way that I pass back the screen coordinates that were active when the window closed. However, I always get "0, 900" in my alert. If I move the windX and windY assignments out of the function (so that they are assigned when the window is first loaded,) I do get the correct values. However, if the window is dragged around, the values are wrong, and that's kind of the whole point. I can't find a webkit equivalent of "onmove", so my only solution is to keep checking the values periodically, which seems really inefficient. So, two parts: 1) Why, when "saveWindowLocation" is called on "onunload" (if it's called otherwise, it works perfectly,) is it passing back zero and nine hundred, regardless of location 2) Is there a webkit equivalent of the "onmove" event to sort out when a window is moved? Thanks!
Attachments
Note You need to log in before you can comment on or make changes to this bug.