All entries with the tag webkit

Speedy SquirrelFish on Safari

WebKit's new JavaScript interpreter may improve performance for the iPhone.

The Surfin' Safari blog announced SquirrelFish today, a new javascript interpreter for WebKit that is 1.6 times faster than the current interpreter. This is incredible, as Safari is already a super-fast browser, but as John Gruber points out in Daring Fireball, it may mean improved JavaScript support for the iPhone.

If you've read much of this blog, you already know my opinion about the whole "JavaScript on the iPhone really sucks" thing. I was recently reminded of this when translating some jQuery/JSON scripting from the Web to the iPhone. What ran as a fairly simple and speedy app on the Web became unusable on the iPhone, and I had to strip out tons of code to get even basic functions up to speed.

Keep your fingers crossed that SquirrelFish makes it to the iPhone, and soon!  I'm not sure if its release so close to the WWDC conference means it won't be making it to the upgraded "iPhone 2" that everyone is expecting to be announced, or if an iPhone software update will be released after the new iPhones hit the market.  The sooner the better!

The creators of SquirrelFish say this is just the beginning of new breakthroughs in compile times, and it sounds like they've done some very intensive and boring research to create their mutant aquatic rodent.  Thank goodness for the brilliant and patient minds (read: obsessives) who sort these complicated things out so the rest of us can have a better Web experience.

Oh, and yes... as everyone seems to notice, the SquirrelFish logo is way badass. It looks like it may evolve into a StimpyFish in a later release.

Leave comments on this blog, or let's talk on Twitter or Facebook.

Tags: , , , ,

Comments on this post are closed.

Posted on June 3, 2008, 9:29 p.m. Tags: iphone javascript safari webkit

Flash & iPhone Workaround

Use swfObject to "hide" accessible content behind your site's Flash pieces.

swfObjectI recently had a client ask me to adjust her site to be iPhone-compatible.  The navigation of this site uses Flash to apply a cosmetic animation on the text, so her site wasn't navigable via iPhone or any other non-Flash equipped device.

At first I thought I would advise her to forget about the slight effect that the Flash provided and change to a non-animated, but fully accessible navigation system.  But I knew she really liked this small detail of the site, so I thought I would try another way.

...are you using swfObject to embed your Flash content, anyway? Because you probably should be.  swfObject is an  XHTML-valid javascript  method of displaying Flash content without using unwieldy <embed> tags.  The script will fill any old <div> with your Flash, and changing the layout is as simple as adjusting the <div> with your style sheet.  It detects Flash player versions and will help a user upgrade or install the Flash player "in-window" if necessary.  It is a fantastic workaround for the annoying IE "Eolas patent dispute" requirement to "activate" Flash content by clicking it once before any buttons are active.

And -- thanks to the way that it degrades gracefully -- swfObject lets you "hide" accessible content behind your Flash.  I often use text describing the Flash content to boost a page's search engine indexability. Though this text is visually replaced by swfobject.js, it remains in the source code when the page renders.

In the case of the iPhone, the Flash is simply not displayed, and whatever originally was in the swfObject-specified <div> shows through. This is where you put a static but more-accessible version of the Flash image. You can include any kind of xhtml, links, images, or even embedded swfs.

In this case I simply made an html-friendly version of the client's site navigation, placed it in the navigation <div> and specified that swfObject would replace that content with the Flash nav where possible.  Voila!  The client sees her subtle Flash nav effect on her home computer, and can use her site from her iPhone as well (with minimal visible difference, as the Flash effect was a rollover effect anyway).

I have also used this trick to "hide" a jpg of a site's logo or header behind a Flash version... this way when viewing on the iPhone, that most important piece of your site (your identity) isn't lost!

swfObject was created by Geoff Stearns.
Click here to download the project from Google Code.

Tags: , , , , ,

Comments on this post are closed.

Posted on Feb. 23, 2008, 5:56 a.m. Tags: flash iphone javascript webkit

Safari SDK Snafu

Was the failure of the Safari SDK anticipated by Apple?

In my last post I wrote about mobile application design and how form should disappear in the face of function.  The implementation of MobileSafari on the iPhone comes so very close to giving developers a toolkit to accomplish this with pizazz, but there are a couple issues holding it back from its full potential:

The "dev kit" that Apple offers doesn't allow access to the phone's features.
This was covered in my last post. Lack of access to the camera, microphone, speaker, alerts etc. hinder iPhone apps from being fully effective.

MobileSafari's support for Web standards is subpar.  The implementation of the Web standards that Apple touted as an application development platform are disappointing.  Javascript behavior is slow and unreliable, and even some CSS properties do not behave according to the Web standards that Apple touted as the future of the iPhone.

This may have come as a surprise to Apple.  As far as I know they have never said outright that the Safari browser and its Mobile counterpart can behave like two different animals, but as someone who spends a lot of time with both, I know it to be true.  This is something that I had considered worth overlooking for a while as the platform was improved on; but rather than fixing the current problems and bringing MobileSafari up to speed with JavaScript handling, iframe display, and the rest, Apple seems to be applying Band-Aid fixes instead, by using custom CSS and Javascript events that work around existing limitations.

At the VON conference this fall, I heard the claim that Apple never second-guesses themselves, that every move is planned well in advance.  While I don't doubt that this is true, this claim was accompanied by the assertion that Apple never makes a mistake.  That the 3rd-party SDK later release was intentional. That the sucky Safari SDK was never intended to be the "real" platform for the iPhone.  Even that the $100 early-adopter rebate was all planned from the beginning.

I don't really agree with this stance; I obsessively read everything iPhone-related that I could get my hands on for MONTHS, and I follow Apple pretty closely.  While it's true that they haven't taken many false steps since Jobs came back on board with the launch of the original iMac and the iPod, there have been a few recent products that weren't exactly flops, but I'm sure they didn't go the way Apple planned them to.

Part of the reason I would hate to think that Apple made no mistakes is this: if the whole Safari SDK - price drop/refund - 3rd-party app saga was all part of some grand scheme on Apple's part, that would qualify in my book as majorly planned obsolescence.  More than I'm comfortable with, in fact.  Especially as a Web developer - so what, was Apple just messing with my mind?  I don't my (imaginary) type of relationship with Steve Jobs is Walt Disney exactly, but I don't think it's Ike Turner either.

The idea that everything Mac is orchestrated perfectly from on high might work somehow...except for the fact that some things with the iPhone haven't gone as initially (publicly) planned.  And the planned obsolescence angle just doesn't fit the company's profile.  Sure, tech stuff (and especially gadgets) improves in leaps and bounds.  I spend thousands of dollars every year chasing the newest carrot that technology dangles in front of me; I'm a total sucker for that.  But I think this is just a little too off-track to be intentional.  Apple has been plenty cool about people hacking their iPhones, and I don't doubt that they are working as hard as possible to achieve maximum development AND maximum profit at the same time.  So I disagree that the whole thing was planned from the start; I'm chalking it up to "bumps in the road" that will one day lead us to the modern mobile Internet that I envision.

I am, of course, interested in your opinion.  Do YOU think the whole iPhone timeline has been completely engineered?  Let's talk about it in the comments of this post.

This is the second part of a series of posts, starting with the present and leading us into the future of the mobile Web. Stay tuned.
Next up: Integration of mobile app platforms...

Tags: , , , , , , , , ,

Comments on this post are closed.

Posted on Dec. 15, 2007, 6:29 a.m. Tags: apple apps iphone javascript mobile safari sdk webapps webkit