Update 6/8/09: This still happens in the release version of Safari 4.
Update 6/13/09: More details available at Sakuzaku.
I have been unable to verify if this is a widespread problem or just my luck, but my Java bookmarklets are no longer working in the Safari 4 beta. Bookmarklets are mini-applications that can be run by a web browser.
Specifically, I use two bookmarklets to quickly resize my browser window in an attempt to solve my frustration with Mac OS X not having a proper “maximize” button. One bookmarklet makes the window take up the whole screen, the other makes the window smaller and recenters it. They sit in my bookmarks bar, and so resizing/recentering is just a click away (or, a command-1 or command-2 away — the only time I’ve ever appreciated that Safari chooses bookmarks, not tabs, in that manner). But suddenly in Safari 4, neither is working!
The maximize bookmarklet is:
javascript:self.moveTo(0, 0); self.resizeTo(screen.availWidth, screen.availHeight);
The small window bookmarklet is:
javascript:self.resizeTo(1024, screen.availHeight * .9);self.moveTo((screen.availWidth - 1024) / 2, screen.availHeight - screen.availHeight * .95);
Is anyone else having problems executing this code?
Edit (5 minutes later): And now it’s working again! Never mind! Maybe it was related to some hacking I was doing in Safari’s developer settings… more on that later if it turns out interesting.
Edit (10 pm): The problem is related to multiple tabs being open. Bookmarklets work fine with just one tab.
{ 1 trackback }
{ 8 comments… read them below or add one }
Hi, same problem here. Bookmarklets work in a window with a single tab, but as soon as there is a second one they stop working. What kind of settings did you hack?
You’re right — it’s the tabs which are breaking it. I didn’t notice that before. The settings, unfortunately, had nothing to do with this…
Same issue here. Please update if anyone finds a workaround.
Thanks!
This is apparently still broken in the final version of Safari 4.
There seems to be a WebKit bug filed for it (https://bugs.webkit.org/show_bug.cgi?id=24218), but there’s no action on it yet.
I have the same problem, and I usually have a set of tabs I want to control. This all worked fine right up until version 4.
I didn’t get a valid WebKit bug id when I followed the above link.
More problems with Safari 4, relating to tabs:
I have some bookmarklets that let me operate on the current page, for instance:
javascript:void(document.location=’http://validator.w3.org/check?url=’+document.location)
Frequently I want the source page to stay up in a tab, so I’ll hold down my “apple” key when invoking the bookmarklet on the source page. In Safari 4, that has quit working. The bookmarklet still works, but it no longer looks for the Apple key down, or else ackt like it doesn’t. Luckily, I can just hit the back arrow while holding down the Apple key and I still can get it, so not so bad.
One more issue involving tabbed browsing: I have used “Saft” on MacOS for several years now, with no problems ever, but I had to remove it for the first time after upgrading to Safari 4, because doing an “open in tabs” from the bookmarks bar crashes Safari if Saft is installed.
Definitely some strangeness with tabbed browsing. Maybe some smart person will see what’s tying these problems together and get that thing fixed!
Same problem here with latest Safari 4.0.4 (5531.9) — This is really annoying…
Hi, the bug might not be related to bookmarklets but to certain methods of the window/document/self-objects. Even in regular javascript resizeTo, moveTo, or other methods or properties setting position or size don’t work with multiple tabs open.