Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit c7f762c

Browse files
committed
Merge branch 'master' into downloadIconsSupportSrc
2 parents c311164 + 22c8ba6 commit c7f762c

File tree

4 files changed

+68
-8
lines changed

4 files changed

+68
-8
lines changed

lib/manifestTools/assets/web-manifest.json

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"format": "uri"
4040
},
4141
"theme_color": {
42-
"description": "background color for splash screen and icons",
42+
"description": "The default theme color for the browsing contexts of an application",
4343
"type": "string"
4444
},
4545
"dir": {
@@ -68,8 +68,29 @@
6868
"prefer_related_applications": {
6969
"description": "A boolean value that is used as a hint for the user agent to say that related applications should be preferred over the web application.",
7070
"type": "boolean"
71+
},
72+
"categories": {
73+
"description": "An array of strings defining the expected application categories to which the web application belongs. While any string is considered valid, W3C maintains a list of known category strings at https://github.com/w3c/manifest/wiki/Categories",
74+
"type": "array"
75+
},
76+
"screenshots": {
77+
"description": "An array of images representing the application in common usage scenarios.",
78+
"type": "array",
79+
"items": {
80+
"$ref": "#/definitions/icon"
81+
}
82+
},
83+
"iarc_rating_id": {
84+
"description": "The International Age Rating Coalition (IARC) certification code of the web application. It is intended to be used to determine which ages the web application is appropriate for.",
85+
"type": "string"
86+
},
87+
"shortcuts": {
88+
"description": "An array of shortcut items that provide access to key tasks within a web application.",
89+
"type": "array",
90+
"items": {
91+
"$ref": "#/definitions/shortcutItem"
92+
}
7193
}
72-
7394
},
7495

7596
"definitions": {
@@ -97,6 +118,15 @@
97118
"description": "The type member of an icon is a hint as to the media type of the icon.",
98119
"type": "string",
99120
"pattern": "^[\\sa-z0-9\\-+;\\.=\\/]+$"
121+
},
122+
"purpose": {
123+
"description": "An unordered set of unique space-separated tokens that are ASCII case-insensitive. The allowed values are the icon purposes.",
124+
"type": "string",
125+
"enum": [ "badge", "maskable", "any" ]
126+
},
127+
"platform": {
128+
"description": "The platform to which a containing object applies.",
129+
"type": "string"
100130
}
101131
}
102132
},
@@ -117,6 +147,35 @@
117147
"type": "string"
118148
}
119149
}
150+
},
151+
"shortcutItem": {
152+
"type": "object",
153+
"properties": {
154+
"name": {
155+
"description": "The name of the shortcut as it is usually displayed to the user in a context menu.",
156+
"type": "string"
157+
},
158+
"short_name": {
159+
"description": "A short version of the name of the shortcut. It is intended to be used where there is insufficient space to display the full name of the shortcut.",
160+
"type": "string"
161+
},
162+
"description": {
163+
"description": "Describes the purpose of the shortcut. User agents MAY expose this information to assistive technology",
164+
"type": "string"
165+
},
166+
"url": {
167+
"description": "The URL within the application's scope that opens when the associated shortcut is activated.",
168+
"type": "string",
169+
"format": "uri"
170+
},
171+
"icons": {
172+
"description": "The images to serve as iconic representations of the shortcut in various contexts.",
173+
"type": "array",
174+
"items": {
175+
"$ref": "#/definitions/icon"
176+
}
177+
}
178+
}
120179
}
121180
}
122181
}

lib/manifestTools/manifestCreator/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ function manifestCreator(opts, callback) {
3939
'Dir',
4040
'Lang',
4141
'Name',
42+
'Short_name',
4243
'Icons',
4344
'Scope',
4445
'Display',
4546
'Start_url',
46-
'Short_name',
47+
'Background_color',
4748
'Theme_color',
4849
'Description',
4950
'Orientation',
50-
'Background_color',
5151
'Related_applications',
5252
'Prefer_related_applications'
5353
].map(function(name) {

lib/manifestTools/manifestLoader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var constants = require('../constants'),
2020
var manifestCreator = require('./manifestCreator');
2121

2222
// Request settings taken from https://github.com/InternetExplorer/modern.IE-static-code-scan/blob/master/app.js
23+
// Then the user agent is updated to that of a PWA-capable browser
2324
var request = request.defaults({
2425
followAllRedirects: true,
2526
encoding: null,
@@ -29,7 +30,7 @@ var request = request.defaults({
2930
headers: {
3031
'Accept': 'text/html, application/xhtml+xml, */*',
3132
'Accept-Language': 'en-US,en;q=0.5',
32-
'User-Agent': 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)'
33+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36'
3334
}
3435
});
3536

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)