1 <h1>Manifest for storage areas</h1>
4 Unlike the <code>local</code> and <code>sync</code> storage areas, the
5 <code>managed</code> storage area requires its structure to be declared as
6 <a href="http://tools.ietf.org/html/draft-zyp-json-schema-03">JSON Schema</a>
7 and is strictly validated by Chrome. This schema must be stored in a file
8 indicated by the <code>"managed_schema"</code> property of the
9 <code>"storage"</code> manifest key and declares the enterprise
10 policies supported by the {{platform}}.
14 Policies are analogous to options but are configured by a system
15 administrator instead of the user, allowing the {{platform}} to be
16 preconfigured for all users of an organization. See
17 <a href="http://www.chromium.org/administrators/">how Chrome handles policies</a>
18 for examples from Chrome itself.
22 After declaring the policies they can be read from the
23 <a href="../storage.html#property-managed">storage.managed</a> API.
24 It's up to the {{platform}} to enforce the policies configured
28 <h2 id="manifest">Sample manifest.json</h2>
31 The <code>storage.managed_schema</code> property indicates a file
32 within the {{platform}} that contains the policy schema.
35 <pre data-filename="manifest.json">
37 "name": "My enterprise {{platform}}",
39 "managed_schema": "schema.json"
46 Chrome will then load these policies from the underlying operating system
47 and from Google Apps for signed-in users. The
48 <a href="../storage.html#event-onChanged">storage.onChanged</a>
49 event is fired whenever a policy change is detected, including while
50 the browser wasn't running if the {{platform}} uses
51 <a href="../event_pages.html">event pages</a>.
52 You can verify the policies that Chrome loaded at
53 <a href="chrome://policy">chrome://policy</a>.
56 <h2 id="format">Schema format</h2>
59 The JSON Schema format has some additional requirements from Chrome:
63 <li>The top-level schema must have type <code>object</code>.</li>
64 <li>The top-level <code>object</code> can't have
65 <code>additionalProperties</code>. The <code>properties</code>
66 declared are the policies for this {{platform}}.</li>
67 <li>Each schema must have either a <code>$ref</code> value or exactly one <code>type</code>.</li>
71 If the schema is invalid then Chrome won't load the extension and will
72 indicate the reason why the schema wasn't validated. If a policy value
73 does not conform to the schema then it will not be published by the
74 <code>storage.managed</code> API.
77 <h2 id="sample">Sample schema</h2>
79 <pre data-filename="schema.json">
83 // "properties" maps an optional key of this object to its schema. At the
84 // top-level object, these keys are the policy names supported.
87 // The policy name "AutoSave" is mapped to its schema, which in this case
88 // declares it as a simple boolean value.
89 // "title" and "description" are optional and are used to show a
90 // user-friendly name and documentation to the administrator.
92 "title": "Automatically save changes.",
93 "description": "If set to true then changes will be automatically saved.",
97 // Other simple types supported include "integer", "string" and "number".
102 "DefaultServiceUrl": {
106 // "array" is a list of items that conform to another schema, described
107 // in "items". An example to this schema is [ "one", "two" ].
115 // A more complex example that describes a list of bookmarks. Each bookmark
116 // has a "title", and can have a "url" or a list of "children" bookmarks.
117 // The "id" attribute is used to name a schema, and other schemas can reuse
118 // it using the "$ref" attribute.
121 "id": "ListOfBookmarks",
125 "title": { "type": "string" },
126 "url": { "type": "string" },
127 "children": { "$ref": "ListOfBookmarks" }
132 // An "object" can have known properties listed as "properties", and can
133 // optionally have "additionalProperties" indicating a schema to apply to
134 // keys that aren't found in "properties".
135 // This example policy could map a URL to its settings. An example value:
138 // "blacklisted": true
141 // "bypass_proxy": true
146 "additionalProperties": {
149 "blacklisted": { "type": "boolean" },
150 "bypass_proxy": { "type": "boolean" }