Xitong Liu's Blog Home Photos About

Safari 5, Apple’s next generation browser

June 11 2010 – Newark

Apple updated its browser Safari to version 5 on the first day of WWDC 2010, both on Mac and Windows. In the war of browser recently, each update will draw dense attention all around the industry. So, what’s new in Safari 5?

The return of progress bar

One of Safari’s most famous and elegant innovation is the integration of progress bar and address bar, and it’s ported to Safari mobile on iPhone OS (which has been renamed as iOS). I don’t know why the progress bar was replaced by a meaningless loading box in Safari 4. For a large webpage under slow connection, it’s unclear what’s going on when loading the webpage. Fortunately, the missing feature is restored in Safari 5.

Better HTML5 support

HTML5 is a hot topic in the recent years. All the browser vendors are try their best to add support for HTML5. Safari 5 add many a dozen new HTML5 features, including better video support, geo-location, WebSocket, etc. Apple has created a library to show the most fancy features of HTML5, most of them are built on webkit’s proprietary CSS3 properties, e.g. -webkit-transform, -webkit-gradient. Unfortunately, it has opted out the support of other browsers, including Google Chrome which was also built on webkit. Intuitively, Apple want to show that Safari can survive without Adobe’s flash.

Fix of quirk tab behavior

Most new Mac users may feel unacceptable about the quirk tab behavior of Safari, as the links are always open in new window by default. If you want to open new link in new tab, only ⌘ + Click may work. Many third party plugins can make Safari’s tab behave the same as Firefox or Chrome, but it may slow down Safari or even make Safari crash-prone. Safari 5 saves us from pressing ⌘ when opening links in new tab by providing new option regarding tab behavior.

Faster than ever before

It’s awesome! Apple advertises that with the help of its latest javascript bytecode engine: Nitro, Safari can run faster even faster than the V8 engine in the latest Google Chrome 6. I have tried to validate Apple’s declaration by running the SunSpider1 benchmark both on Safari 5 and Chrome 6. The test platform is MBP 13 inch, 2.26 GHz Intel Core Due 2, 2 GB memory. The final score of Safari 5 is 358.2ms, and that of Chrome 6 is 362.8ms, which kept consistent with Apple’s declaration that Nitro is 3 percent faster than V8. Hopefully, V8 may surpass Safari 5 again in the next release.

Safari Reader

I think this is the most exciting new feature of Safari 5. Currently people read more and more news articles online. However, almost all the news article webpages are filled with annoying advertisements which may distract users from reading news. What’s more, most long news articles are paginated into several parts, and users have to click next page again and again when the current page is finished. It’s both time and bandwidth consuming. With the help of Safari Reader, the news articles can be extracted and reformatted into a more readable page. Also, for paginated articles, if you open Safari Reader on the first page, the following parts of the article will be loaded automatically to be represented in a continuous, clutter-free view when you scrolling down to the formatted page, which will save a lot of time.

To launch Safari Reader, press Shift + Cmd + R or click the Reader icon in the right side of address bar when it’s available. Safari will detect whether the current page only contains a single article and show the Reader icon automatically. It works well on most website, both on famous English news media like NYTimes or Chinese news media like SINA, as well as common website such as my blog. According to some reference, it’s based on Arc90 Lab’s Readability project which is opensourced under Apache License.

Basically I think it works by matching the only container in which there are several <p></p> elements above a threshold (say, more than 5 paragraphs in the container). Once matched, the paragraphs are extracted and reformatted into a clear way (black text with white background in elegant font). With Apple’s gorgeous font sub-pixel smoothing rendering technology, reading in Safari Reader is kind of enjoyment. A friend of mine said that he had seen a demonstration of Microsoft Research’s new technology which is based on browser vision detection. It works by dividing the page into several rectangles and extracting the content in the target rectangle which the user may concentrate on. I think the time complexity of Microsoft’s solution is much higher than that of Readability and currently it’s not applicable in commercial browsers.

References

1 SunSpider, a JavaScript benchmark. This benchmark tests the core JavaScript language only, not the DOM or other browser APIs. It is designed to compare different versions of the same browser, and different browsers to each other.

Add Comments