19 April, 2013

Chrome OS: Stuff the "glorified browser" naysayers simply don't knowabout

Okay, "glorified browser" naysayers: What happens when you create an HTML file in Adobe Dreamweaver, Kompozer, etc. along with the necessary Javascript, save it to your desktop, and right-click it? Notice how there's nothing but a list of Web browsers on the list of apps that can open the file?

Try downloading this very article, this very page, in fact, to your desktop by clicking the button below and see what happens when you open it locally:

As you can see, HTML + CSS + Javascript code CAN be executed locally. And if that combination can be executed locally, so can a whole Web app be executed locally. In fact, there is such a thing. It's called a packaged app, and it's precisely what makes Chrome OS much more valuable than people think.

What a packaged app does: It is installed via a .crx package, the very same metadata-enhanced .zip file that Chrome extensions (and hosted apps) use as installation media. However, there's one key difference: A hosted app ONLY unpacks metadata (manifest.json) from its .crx file. A packaged app, in contrast, also has ALL the HTML, Javascript, CSS, Native Client, and whatever else packed into the .crx file along with the metadata. This means that not only do packaged apps run offline, but they can also take advantage of some APIs that hosted apps can't. They can theme their own windows. They can access USB, Bluetooth, and other hardware devices. They can request unlimited persistent storage. They can even run in the background and listen for events such as when USB devices are plugged/unplugged, when the Internet is connected/disconnected, or when the browser/OS is shut down/rebooted.

For a perfect example of what kind of power is stuffed into the Javascript APIs that make up the packaged apps, one needs to look no further than CIRC:

A full-fledged IRC client. That's just one example of the kind of power packaged apps are able to possess. Not to mention, of course, that there is an ever-increasing boatload of apps that all work without an Internet connection, and almost half of those are packaged apps that actually do install themselves. Many internal Chrome OS apps are the same way. Case in point: the calculator.

And the file manager:

In both of these cases, what do we see? Apps that are both installed offline and function offline, without the need for an Internet connection, and can take advantage of some tools (such as hardware device access in the file manager case) that simply cannot happen with a hosted Web app.

Yet people still don't get it. They seem to think that if it's a "browser OS", it's impossible to run offline. Please. Between HTML5 AppCache and packaged apps, there's absolutely no reason to complain on that front. Developers just need to learn that packaged apps make MUCH more sense than hosted apps do. The minute they actually learn that, Chrome will actually become more of an app platform than once thought, and people will actually begin to see that Chromebooks DO have more functionality than just web browsing. Well screw you, guys! These examples alone are enough to invalidate your claims, not to mention the boatload of HTML5 AppCache apps that are also installed from the Web Store can define local storage permissions in the manifest file instead of needing to pop up a banner asking for AppCache permission. The result? Less time waiting for user interaction, and more time enjoying offline functionality.