Add full-page zooming to WebKit

In my hands on with Firefox 3 report, one of the new features that I really liked was the full-page zoom. Browsers have always let you increase or decrease the size of text on a web page, but Firefox 3 will also zoom (or shrink) images and other page content, which helps the page keep its original layout as it changes in size. Safari, unfortunately, doesn’t yet have this feature.

But WebKit, the open source web page rendering engine that powers Safari, is capable of doing full-page zooming—it’s just not enabled by default. (I talked about WebKit in my recent Safari Tips video blog; it’s very simple to install and use, and you get access to improvements in the rendering engine before they’re released in the next Safari update.)

If you’re running WebKit and would like to add full-page zooming, here’s what to do. First, quit WebKit and Safari. Then open Terminal (in Applications -> Utilities), copy and paste the following command, and press Return:

defaults write com.apple.Safari WebKitDebugFullPageZoomPreferenceKey 1

Launch WebKit, and then use the View -> Make Text Bigger and Make Text Smaller menu items—or just press Command-Plus or Command-Minus—to see the new feature in action. You’ll see that the entire page now scales up or down, including text, images, and page elements. The end result is a page that looks much better when increased or decreased in size—elements no longer overflow their containers, and images are still aligned with the text they’re supposed to be aligned with. If, for some reason, you decide you don’t like this behavior, it’s easy to reverse. Quit WebKit, and then delete the key you added. In Terminal, type:

defaults delete com.apple.Safari WebKitDebugFullPageZoomPreferenceKey

Alternatively, you can just repeat the original command but change the 1 to a 0, but deleting the entire key is cleaner. When Apple releases a future update to Safari, this feature will start working there as well. For now, though, you’ll need to use WebKit if you want to use full-page zooming.

Shop Tech Products at Amazon