Update: Safari 4 still breaks bookmarklets

June 8, 2009 in Internet

When the Safari 4 beta came out, I observed that having more than one tab open would break any resize bookmarklets. I can confirm that this is still the case in the stable release of Safari 4.

Cody Robbins commented on my original post and noted that the problem has been filed as a WebKit bug. This means it may be indicative of larger problems with WebKit's JavaScript framework. Which is a shame, because Java screams in Safari 4.

Interestingly, I couldn't get any resize bookmarklets to work in Google Chrome, which is also based on WebKit, even though I use other bookmarklets in Chrome on a daily basis. The mystery lives on...

{ 2 comments… read them below or add one }

Cody Robbins June 13, 2009 at 8:27 pm

I downloaded the WebKit source today and did some digging, and I think the problem is actually in Safari and not WebKit. So, we’ll probably have to wait for Apple to fix the problem. I wrote a blog post about it at http://blog.wearesakuzaku.com/fixing-maximize-bookmarklets-in-safari-4/.

Reply

ben August 9, 2009 at 9:06 am

Raised editorially…

It occurs to me that window.foo() doesn’t work in Safari bookmarklets, which means that you need to invoke self.foo() instead. The reference behind self, meanwhile, can be pretty much whatever the browser engineers want it to be – one imagines that Safari 4 relates tabs to their parent window in a an uncommon (new?) way, which in this case means that self references the open tab rather than its window.

Huh.

Reply

Leave a Comment

Previous post:

Next post: