Web apps have been around for a while, but the ability to install them as if they were native apps is relatively new. This blog post takes a look at what’s currently possible.
Web apps are called installable if they can be installed natively. Such apps are currently delivered in either one of two formats:
In order to publish a web app, to put it online, two options are common:
The main reason for the existence of packaged apps is that it is easy to sign them via public-key cryptography: Each app developer gets a public and a private encryption key. Their signature is a hash of the package contents, encrypted via the private key. The signature proves who created the package and is validated by decrypting it with the public key and checking that the resulting hash is correct. The hash also ensures that no one has tampered with the archive.
The kind of signing that I have just described tracks developers, not apps. As a benefit, developers can sign and publish their apps themselves; there is no need to submit them to an app store. But this approach still enables several security measures:
Obviously, for maximum security and less technically savvy users, this approach can still be complemented by a curated app store where each app has been reviewed.
Apache Cordova (on which PhoneGap is based) is the classic solution for turning web apps into native apps. Alas, it requires intermediate steps: building the native app and – often – submitting it to a proprietary app store. On the other hand, you do get comprehensive access to native APIs.
The platforms supported by Cordova are: Amazon Fire OS, Android, Firefox OS, iOS, Ubuntu, Windows Phone, Windows, and others.
The following subsections cover additional solutions, which often do not require intermediate steps to go from web app to native installation.
Firefox: can create native apps from running web apps.
<link>
element and let Firefox trigger the installation. Third, on OS X, you must use the context menu to open a native app for the first time (i.e., it is not natively signed and Gatekeeper initially prevents it from running).Chrome: So-called “Chrome Apps” can be hosted or packaged, but they can only be installed via the Chrome Web Store. Thus, self-publishing is not possible on Chrome.
Windows 8: allows you to write native apps in JavaScript, but many of the non-UI APIs are proprietary.
Ubuntu: lets you write native apps in HTML5.
<link>
and <meta>
elements. Second, the app has to be open long enough for it to be cached if it is to work offline (source).Currently, the manifest files used by Mozilla and Google are different. However, both companies recently agreed on a common standard. The following are two examples from the specification.
Example 1: a typical manifest.
{
"name": "Super Racer 2000",
"icons": [{
"src": "icon/lowres",
"sizes": "64x64",
"type": "image/webp"
}, {
"src": "icon/hd_small",
"sizes": "64x64"
}, {
"src": "icon/hd_hi",
"sizes": "128x128",
"density": "2"
}],
"start_url": "/start.html",
"display": "fullscreen",
"orientation": "landscape"
}
Example 2: linking to the manifest.
<!doctype>
<html>
<title>Store finder - search</title>
<!-- Startup configuration -->
<link rel="manifest" href="manifest.json">
<!-- Fallback application metadata for legacy browsers -->
<meta name="application-name" content="Store Finder">
<link rel="icon" sizes="16x16 32x32 48x48" href="lo_def.ico">
<link rel="icon" sizes="512x512" href="hi_def.png">
Apart from signing apps, packages could serve two more use cases:
Alas, packaged apps as supported by Mozilla and Google currently have two problems:
To fix these problems, Mozilla’s Jonas Sicking recently proposed four measures:
http://example.com/myapp.package!//img/logo.jpg
(!//
would separate the path of the package from the path inside the package).Source of this section: “Future of packaged apps” by Jonas Sicking.
Reviewers of this blog post: