Apple's 'AdLib' Framework Brings Native-Like Functionality to iPad Web Pages


Demonstration of iPad User Guide utilizing 'AdLib' framework

Done21 reports on the curious discovery of a new Web-based framework used in the iPad that allows web pages to behave in ways much more akin to native applications than previously observed. The framework, dubbed 'AdLib' by the report's author after the name of the file containing the code, was first noticed in action when navigating to Apple's iPad User Guide using the iPad's mobile version of Safari. It allows the user guide, which is simply a web page, to be offered in a split-pane view with scrollbars and with a native app-like feel.

What's particularly interesting is that it does something that shouldn't really be possible in Mobile Webkit: It includes scrolling panes that can be manipulated with a single finger, complete with the signature iPhone OS "scroll bars" and elastic transitions. If you have ever worked with Safari on the iPhone, you know that having scrolling boxes of content is sort of possible, but requires a special two-finger gesture to scroll.

Curiosity got the best of me, so I loaded the page in Safari on my laptop (and changed Safari's user agent to mimic the iPad) and got to work with the developer tools. After extracting the JavaScript and de-minifying it, my suspicions were confirmed. Apple was manually reading the touch events, calculating the inertia of the scrolling, and manually drawing the scroll bars. It was incredible that it worked so smoothly in the browser.

The framework, which weighs in at about 4,300 lines of code, permits Mobile Safari to display the native-like user guide simply using HTML, CSS, JavaScript, the basic web technologies supported by the iPhone and iPad. It appears similar in some respects to the PastryKit framework described by John Gruber last December, although AdLib appears to be a more advanced version that incorporates iPad-specific references.

It remains to be seen whether Apple will release the custom API for use by third-developers, but despite an absence of documentation, the report notes that the framework is "extremely well thought out and complete" and could be of significant utility to developers.

Update: For those interested in the actual code, a commented version has been discovered on Apple's developer site.

Popular Stories

iPhone 16 Pro Max Generic Feature 2

5 Biggest Changes Rumored for iPhone 16 Pro Max

Tuesday May 21, 2024 7:29 am PDT by
Given Apple's rumored plan to add an all-new high-end tier to its iPhone 17 series in 2025, this could be the year for Apple to bring its boldest "Pro Max" model to the table — the kind of iPhone 16 upgrade that stands tall above its siblings, both figuratively and literally. If you have been holding out for the iPhone 16 Pro Max, here are five of the biggest changes rumored to be coming...
6chatgpt mac app

5 Reasons to Use OpenAI's ChatGPT App for Mac

Thursday May 23, 2024 6:07 am PDT by
On May 13, OpenAI during its Spring Update announced that it would be releasing a desktop ChatGPT app for the Mac in the "coming weeks," and said that ahead of a wider launch it had started rolling out the app to some ChatGPT Plus subscribers. Subscribe to the MacRumors YouTube channel for more videos. After testing the app for a few days, we thought it was worth sharing some reasons why...
macOS 15 Feature

macOS 15 System Settings to Get Design Overhaul

Thursday May 23, 2024 12:51 pm PDT by
With the macOS 15 update that is set to debut at WWDC in June, Apple plans to rearrange "menus and app UIs," according to a report from AppleInsider. The System Settings app, which was last updated with macOS Ventura, will get one of the biggest updates. With macOS Ventura, Apple renamed the System Preferences app to System Settings, introducing a design similar to the Settings app on the...
new best buy blue

Best Buy's Memorial Day Sale Has Record Low Prices on iPads, MacBooks, and Much More

Friday May 24, 2024 7:12 am PDT by
Best Buy today kicked off its Memorial Day weekend sale, and it has some of the best prices we've tracked in weeks on iPads and MacBooks. Specifically, you'll find record low prices on the 5th generation iPad Air, iPad mini 6, M2 MacBook Air, and M3 MacBook Pro. Note: MacRumors is an affiliate partner with Best Buy. When you click a link and make a purchase, we may receive a small payment,...