Chrome app development best practices

If you’re writing Chrome apps, we recommend these Chrome app development best practices, including those specific to Chrome Apps and best practices for large web projects that also apply to Chrome Apps.

Best practices specific to Chrome Apps

Build the capability for internationalization into your app

Use the chrome.i18n API and /_locales/.

Even if you don’t initially plan to offer more than English, supply the English strings via /_locales/ and chrome.i18n if you want to easily expand later.

Decide in advance if your app needs the ability to run offline

Once your app is written, it’s not trivial to retool it to run offline.

Set the flag in the manifest. As of Chrome 35, apps are assumed to be offline-enabled and the offline_enabled value defaults to true, unless webview permission is requested.

Test on Chrome and Chrome OS

While it’s easier to develop on Chrome than on Chrome OS, if your app will be used on Chrome OS you need to regularly test on all four Chrome OS channels (Stable, Beta, Dev, and Canary).

Test regularly on a device in each Chrome channel

Because Chrome releases new features frequently, the development platform can change often. By testing regularly, you find out as soon as possible if one of these changes breaks your app.

Rotate development across Chrome OS devices on Stable, Beta, Dev, and Canary channels (use the command line flag to change to Canary).

Test in kiosk mode (if applicable)

Because kiosk mode can render things differently than in normal Chrome OS full-screen mode, test in kiosk mode on a Chrome device.

Create a dev, beta, and production app in the Chrome Web Store

Create a development version of the app that’s only available to people in a certain group, and create a beta version of the app that’s unlisted. Having these versions lets others test the application quickly and without too much risk.

Identify and understand all available APIs

Browse the public API documentation on the Chrome developer site, such as Chrome Platform APIs and Network and Hardware APIs.

Browse the API definitions in the Chrome source code to see which APIs might be available but aren’t yet documented.

Is it safe to use undocumented APIs? It’s risky because undocumented APIs might change or go away without notice. If you use them, test on the Canary channel so you know right away if there’s an API change.