Safari 4 breaks bookmarklets?

March 1, 2009 in Internet

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.

{ 9 comments… read them below or add one }

Leave a Comment

{ 1 trackback }

Previous post:

Next post: