1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
<h1>Packaged Apps</h1>
<p class="warning">
<b>Warning: </b>
All content in this doc refers to the legacy version of packaged apps.
Legacy packaged apps are discontinued, and Chrome will <strong>stop loading them
</strong> in June 2015.
Check out the new version of <a href="../apps/about_apps">Chrome Apps</a> or
read the <a href="https://developer.chrome.com/webstore/migrating">migration
tutorial for legacy packaged apps</a>.
</p>
<p>
This page talks about legacy packaged apps — how
you implement them,
and how they're different from
extensions and ordinary web apps.
</p>
<h2 id="overview">Overview</h2>
<p>
A legacy packaged app is a web app that's bundled into a <code>.crx</code> file.
In the past, legacy packaged apps could use most of the extension APIs, but
<a href="https://blog.chromium.org/2012/11/restricting-extension-apis-in-legacy.html">
since November 2012</a>, the feature set of legacy packaged apps was reduced.
And in June 2014, discontinuation of legacy packaged apps
<a href="https://blog.chromium.org/2014/06/migrate-your-legacy-packaged-apps-to.html">
was announced</a>; support for them will be removed from Chrome in June 2015.
</p>
<p>
The term "packaged app" used to refer to the "legacy packaged app" as described
in this document, but
<a href="https://blog.chromium.org/2012/08/the-evolution-of-chrome-packaged-apps.html">
since the introduction of Chrome Apps in August 2012</a>, the term "packaged
app" is also used to refer to <a href="../apps/about_apps">Chrome Apps</a>.
Keep this in mind when you read about "packaged apps" in online resources.
</p>
<p>
A close alternative to legacy packaged apps are
<a href="https://developers.google.com/chrome/apps/docs/developers_guide">hosted
apps</a>, which are ordinary web apps with a bit of additional metadata.
To learn more about extensions, packaged apps, and hosted apps, read
<a href="https://developer.chrome.com/webstore/choosing">Choosing an App Type</a>.
</p>
<h2 id="manifest">The manifest</h2>
<p>
A packaged app's manifest can have any field
that's available to extensions,
except for "browser_action" and "page_action".
In addition, a packaged app's manifest <b>must</b>
have an "app" field.
Here is a typical manifest for a packaged app:
</p>
<pre data-filename="manifest.json">
{
"name": "My Awesome Racing Game",
"description": "Enter a world where a Vanagon can beat a Maserati",
"version": "1",
<b>"app": {
"launch": {
"local_path": "main.html"
}
},</b>
"icons": {
"16": "icon_16.png",
"128": "icon_128.png"
}
}
</pre>
<p>
The "app" field has one subfield, "launch",
which specifies the <em>launch page</em> for the app—the
page (HTML file bundled into the <code>.crx</code> file)
that the browser goes to when the user clicks the app's icon
in the New Tab page.
The "launch" field can contain the following:
</p>
<dl>
<dt>local_path:</dt>
<dd><em>Required.</em>
Specifies the launch page
as a relative path referring to a file
in the <code>.crx</code> package.
</dd>
<dt>container:</dt>
<dd> The value "panel" makes the app appear
in an app panel.
By default, or when you specify "tab",
the app appears in a tab.
<!-- PENDING: In the overview
(or somewhere else before here)
we should show and define both app panels and tabs.
We should link to that place from here. -->
</dd>
<dt>height:</dt>
<dd>
If the container is set to "panel",
this integer specifies the height
of the panel in pixels.
For example, you might specify
<code>"height":400</code>.
Note that you don't use quotation marks in the value.
This field specifies the height of the area
to display contents in;
window decorations add a few more pixels to the total height.
If the container isn't a panel, this field is ignored.
</dd>
<dt>width:</dt>
<dd>
Similar to "height",
but specifies the width of the panel.
</dd>
</dd>
</dl>
<p>
Packaged apps usually provide a 16x16 icon
to be used as the favicon for
tabs that contain app's pages.
They also should provide a 128x128 icon,
but not a 48x48 icon.
See the manifest documentation for the
<a href="manifest/icons">"icons" field</a>
for more information.
</p>
<p>
For further details on what a packaged app's manifest can contain, see the
<a href="manifest">manifest documentation</a>.
</p>
<h2 id="next">What next?</h2>
<p>
Read the <a href="overview">Overview</a> to learn
basic concepts about extensions.
</p>
<p class="backtotop"><a href="#top">Back to top</a></p>
|