You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: The web app manifest is a JSON file that gives you the ability to control how your web app or site appears to the user in areas where they would expect to see native apps (for example, a device's home screen), direct what the user can launch, and define its appearance at launch.
4
4
5
-
{# wf_updated_on: 2018-12-11 #}
5
+
{# wf_updated_on: 2019-01-31 #}
6
6
{# wf_published_on: 2016-02-11 #}
7
7
{# wf_blink_components: Manifest #}
8
8
@@ -20,7 +20,6 @@ Having a manifest is required by Chrome to show the
20
20
A typical manifest file includes information about the app `name`, `icons` it
21
21
should use, the `start_url` it should start at when launched, and more.
22
22
23
-
24
23
## Create the manifest
25
24
26
25
A complete `manifest.json` file for a progressive web app.
@@ -47,23 +46,19 @@ A complete `manifest.json` file for a progressive web app.
47
46
"theme_color": "#3367D6"
48
47
}
49
48
50
-
51
49
Note: See the [add to home screen criteria](/web/fundamentals/app-install-banners/#criteria)
52
50
for the specific properties that are required to show the add to home screen
53
51
prompt.
54
52
55
-
56
53
## Tell the browser about your manifest
57
54
58
55
When you have created the manifest, add a `link` tag to all the pages that
59
56
encompass your web app:
60
57
61
-
62
58
<link rel="manifest" href="/manifest.json">
63
59
64
60
## Key manifest properties
65
61
66
-
67
62
### `short_name` and/or `name` {: #name }
68
63
69
64
You must provide at least the `short_name` or `name` property. If both are
@@ -74,7 +69,6 @@ places where space may be limited. `name` is used in the
74
69
"short_name": "Maps",
75
70
"name": "Google Maps"
76
71
77
-
78
72
### `icons` {: #icons }
79
73
80
74
When a user adds your site to their home screen, you can define a set of
@@ -183,13 +177,18 @@ Users prefer selecting the orientation.
183
177
### `scope` {: #scope }
184
178
185
179
The `scope` defines the set of URLs that the browser considers to be within your
186
-
app, and is used to decide when the user has left the app, and should be bounced
187
-
back out to a browser tab. The `scope` controls the URL structure that
188
-
encompasses all the entry and exit points in your web app. Your `start_url`
189
-
must reside within the `scope`.
180
+
app, and is used to decide when the user has left the app. The `scope`
181
+
controls the URL structure that encompasses all the entry and exit points in
182
+
your web app. Your `start_url` must reside within the `scope`.
190
183
191
184
"scope": "/maps/"
192
185
186
+
Caution: If the user clicks a link in your app that navigates outside of the
187
+
`scope`, the link will open and render within the existing the PWA window. If
188
+
you want the link to open in a browser tab, you must add `target="_blank"`
189
+
to the `<a>` tag. On Android, links with `target="_blank"` will open in a
190
+
Chrome Custom Tab.
191
+
193
192
A few other tips:
194
193
195
194
* If you don't include a `scope` in your manifest, then the default implied
@@ -275,7 +274,6 @@ tool. It's built into the Audits tab of Chrome DevTools, or can be run as an NPM
275
274
module. You provide Lighthouse with a URL, it runs a suite of audits against that
276
275
page, and then displays the results in a report.
277
276
278
-
279
277
## What's next?
280
278
281
279
* If you're using a web app manifest, you'll probably want to set up an
0 commit comments