Bug 24218
| Summary: | Safari 4 javascript window resize inconsistency | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kevin M. Dean <kevin> |
| Component: | WebKit Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | josh, stopsendingmejunk, webkitbugs |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac (PowerPC) | ||
| OS: | OS X 10.5 | ||
Kevin M. Dean
I have a series of bookmarks I use to trigger javascript window resizing and moving.
Here's the address fields for some of those bookmarks. Each line is a different bookmark
javascript:self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);
javascript:resizeTo(800,533);
javascript:resizeTo(1024,713);
javascript:moveTo(0,0);
Under Safari 4, if I have 1 tab open, they work as expected. As soon as I open another tab, they no longer work no matter which tab is selected.
I'll submit this via the Safari bug button as well just in case it's their issue.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
ar
Seconded.
It does work sometimes.
I can get it to work on a newly created window (but not consistently... I haven't figure out the pattern), but not a window that's been around the whole session.
Sometimes I can get around it by creating a new window and manually moving all of the tabs from the previous (not working) window to the new one.
Sam Garfield
I think this may be indicative of a more general problem with the javascript engine. Whatever the bug is that is causing this will probably crop up in other places as well.
I rely on these bookmarklets and this is my biggest annoyance with Safari 4/Webkit. But I love everything else so much I can't go back (top bar tabs FTW!) I'm kinda surprised this hasn't gotten more attention as I know a lot of web developers who use these kinds of things.
Kevin M. Dean
Well Safari 4 Final still leaves this broken.
Cody Robbins
Here is a reproducible test case for this bug on my system:
1. Open Safari.
2. Create bookmarks with the following addresses:
javascript:moveTo(0,0);
javascript:resizeTo(100,100);
3. Open two tabs in the same window.
4. Click both bookmarks. Neither results in the expected behavior.
5. Close the second tab so that there is only one tab open in the window, and click both bookmarks. Both result in the expected behavior.
It does not appear to make a difference whether the window is new or has been open for the entire session. The problem occurs if you open Safari fresh and click the bookmarks immediately.
System details:
MacBook Pro 2.2GHz Intel Core 2 Duo
OS X 10.5.7 build 9J61
Safari 4.0 (5530.17)
Cody Robbins
Never mind, I downloaded the WebKit source and tracked what was causing this undesired behavior, and as far as I can tell it appears as though the problem is with Safari, not WebKit.
WebChromeClient::setWindowRect in mac/WebCoreSupport/WebChromeClient.mm sends setFrame:windowRect: to WebUIDelegate with the exact same window rectangle regardless of the number of tabs open. The message simply doesn't result in the window being moved when there is more than one tab.
See http://blog.wearesakuzaku.com/fixing-maximize-bookmarklets-in-safari-4/ for a more detailed explanation.
I filed a bug for Safari on Radar describing the problem. I think this ticket should be closed since it's not a WebKit problem.
Sam Garfield
Are we sure this isn't a webkit problem? The same bug exists in webkit.
Kevin M. Dean
Of course, Safari 5 does nothing to fix this.
Alexey Proskuryakov
> I filed a bug for Safari on Radar describing the problem.
> I think this ticket should be closed since it's not a WebKit problem.
The bug was filed as <rdar://problem/6970303>. But this is really a duplicate of bug 23603, and I'll comment there.
*** This bug has been marked as a duplicate of bug 23603 ***
Kevin M. Dean
There's a new Safari 5 extension that can resize the windows even with multiple tabs. It's quite nice.
http://www.apfelquak.de/2010/06/12/maximize-safari-extension/