Tutorial:Chrome/Manifest.json

All Chrome applications require a manifest.json file. Both extensions and apps require them, and both have very similar files. The manifest.json file is very simple. It will be very helpful to learn before continuing this tutorial, but it is not necessarily required. This file is simple enough that you should be able to create it without even knowing the language.

Required Fields
The file is separated into several different manifest fields. There are only three different fields that are required, the name field, the version field, and the manifest version field. These three fields would look like this:

The manifest_version should simply just always be set to "2". The name, is the name of your app or extension. The version is the version that your app or extension is on. The version should be one to four integers, which can be separated by periods. For example, 1.4.344.5. There are a couple of rules for this, too: they must be between 0 and 65535, inclusive, and non-zero integers can't start with 0.

Recommended Fields
These three fields are the only ones required to run an app or extension. If you copy and paste the above code into an app, it will run. However, there are many other optional fields. Below are some that are highly recommended.

These can be used in addition to the ones above to run an app with more options filled out. The default_locale field is required if you have a _locale subdirectory, or must not be filled out if you do not have a _locale subdirectory. If you do not know what that is, then don't worry.

Icons
The icons field specifies the different icons that can be used inside of the application. These are always square icons, and are represented by a single number. There are three different options, 128x128 pixels, 48x48 pixels, and 16x16 pixels. These would be displayed as 128, 48, and 16 respectively. The 128 sub-field should be filled out in every app and extension. The 48 sub-field should be filled out in all extensions, and is optional for apps. The 16 sub-field is also optional, but can be used as a favicon. Here is an example with all three options filled out.