This page is part of the documentation for the Chrome Apps platform, which was deprecated in 2020. Chrome Apps in Kiosk Mode used by Enterprise and Education customers will no longer be supported after April 2027, marking their end of life. Additionally, all remaining Chrome Apps used in managed environments by Enterprise and Education organizations will reach their end of life in October 2028. Learn more about migrating your app.
This guide gets you started building Chrome Apps with the AngularJS MVC framework. To
illustrate Angular in action, we'll be referencing an actual app built using the framework, the
Google Drive Uploader. The source code is available on GitHub.
About the app
The Google Drive Uploader allows users to quickly view and interact with files stored in their
Google Drive account as well as upload new files using the HTML Drag and Drop APIs. It's a
great example of building an app which talks to one of Google's APIs; in this case, the Google
Drive API.
The Uploader uses OAuth2 to access the user's data. The chrome.identity API handles fetching an
OAuth token for the logged-in user, so the hard work is done for us! Once we have a long-lived
access token, the apps uses the Google Drive API to access the user's data.
Chromeless frames to define the app's own navbar look and feel
Creating the manifest
All Chrome Apps require a manifest.json file which contains the information Chrome needs to launch
the app. The manifest contains relevant metadata and lists any special permissions the app needs to
run.
A stripped down version of the Uploader's manifest looks like this:
The most important parts of this manifest are the "oauth2" and "permissions" sections.
The "oauth2" section defines the required parameters by OAuth2 to do its magic. To create a
"client_id", follow the instructions in Get your client id. The "scopes" list the
authorization scopes that the OAuth token will be valid for (for example, the APIs the app wants to
access).
The "permissions" section includes URLs that the app will access via XHR2. The URL prefixes are
required in order for Chrome to know which cross-domain requests to allow.
Creating the event page
All Chrome Apps require a background script/page to launch the app and respond to system events.
In its background.js script, Drive Uploader opens a 500x600px window to the main page. It also
specifies a minimum height and width for the window so the content doesn't become too crunched:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2012-11-16 UTC."],[],[]]