Copyright © 2020-2021 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.
This specification is a registry of supplementary members for the Web Application Manifest and Web App Manifest - Application Information specifications that provide additional metadata to an application manifest to describe MiniApps. This JSON-based manifest file enables developers to set up basic information, window style, page route, and other information of a MiniApp. The basic information of a MiniApp includes but is not limited to MiniApp ID, app name, version name, version code, minimum platform version, etc.; window style includes but is not limited to the navigation bar, title, window background, etc.; "pages" are used to specify page route information; and "widgets" are used to describe card information.
本规范定义了基于JSON格式的Manifest文件,使开发者可通过Manifest文件设置MiniApp的基本信息、窗口样式和页面路由等信息。这里,MiniApp基本信息包括但不限于MiniApp ID、名称、版本名称、版本号以及最小平台版本等;窗口样式window包括但不限于导航栏、标题和窗口背景等;pages用于指定页面路由信息;widgets用于描述卡片信息。
Note: At present, only a basic subset of MiniApp Manifest is specified, and it will be gradually updated and supplemented based on different scenario requirements.
备注:目前只是列出MiniApp Manifest的一个基础子集,后续会根据不同的场景需求进行渐进式更新和补充。
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This document was published by the MiniApps Working Group as an Editor's Draft.
GitHub Issues are preferred for discussion of this specification.
Publication as an Editor's Draft does not imply endorsement by the W3C Membership.
This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 15 September 2020 W3C Process Document.
A MiniApp manifest extends and profiles the Web App Manifest format [appManifest] and contains metadata associated with a MiniApp.
MiniApp Manifest 是一个JSON文档,其中包含与该MiniApp关联的元数据。
The following members MUST be set in the MiniAppManifest.
The following members MUST be set in the MiniAppManifest.
The following members MUST be set in an ImageResource
.
The following members MUST be set in an ImageResource
.
The following members MUST be set in a MiniAppWidgetResource.
The following members MUST be set in a MiniAppWidgetResource.
The following member MUST be set in a MiniAppPermissionResource.
The following member MUST be set in a MiniAppPermissionResource.
The priority of all other members is OPTIONAL, but MAY be modified by implementations of the manifest format in the case of specific MiniApp extensions.
The following table is a summary of each member:
下表是manifest中每个属性的总结:
Member 属性 | Type 类型 | Required 必填 | Description 描述 | |
---|---|---|---|---|
appID | string | Yes 是 | ID of the MiniApp ID标识 | |
description | string | No 否 | Description 简述 | |
dir | string | No 否 | Text direction 文本方向 | |
icons | src array |
Yes 是 | Application icons 图标 | |
icons | src |
string | Yes 是 | the source of the icon image in the format of a path string 以路径字符串所表示的图标图片来源 |
sizes |
string | Yes 是 |
The applicable resolution sizes of the icon image from the above mentioned src
来自以上src 的图标图片所适用的分辨率大小
|
|
lang | string | No 否 | Language tag 语言 | |
minPlatformVersion | string | Yes 是 | Minimum platform version supported 支持最小平台版本 | |
name | string | Yes 是 | App name 名称 | |
pages | array | Yes 是 | Route information 路由信息 | |
short_name | string | No 否 | Short name 简称 | |
versionCode | string | Yes? 是 | Version code 版本号 | |
versionName | string | Yes 是 | Version name 版本名称 | |
widgets | MiniAppWidgetResource array | No 否 | Widget 卡片 | |
widgets | name | string | Yes 是 | Widget name Widget名字 |
path | string | Yes 是 |
Corresponding page path of Widget. It follows the same path route format as defined in pages .
Widget对应页面路径,采用与pages 中相同页面路由的格式。
|
|
minPlatformVersion | string | No 否 | Minimum platform version supported 支持最小平台版本 | |
window | MiniAppWindowResource | No 否 | Window style 窗口样式 | |
window | navigationBarBackgroundColor | hexColor | No 否 | Background color of the navigation bar 导航栏背景颜色 |
navigationBarTextStyle | string | No 否 |
Background title color, valid values: black and white .
导航栏标题颜色,有效值:black 和white 。
|
|
navigationBarTitleText | string | No 否 | Title text of the navigation bar 导航栏标题文字内容 | |
navigationStyle | string | No 否 |
Style of the navigation bar, valid values: default (default style) and custom (customized navigation bar). Note: The capsule button at the right corner is not customizable.
导航栏样式,有效值:default (默认样式)和custom (自定义导航栏)。注意:右上角胶囊按钮不可自定义。
|
|
backgroundColor | hexColor | No 否 | Background color of the window 窗口的背景颜色 | |
backgroundTextStyle | string | No 否 |
Background text style, valid values: dark and light .
背景文字样式,有效值:dark 和light 。
|
|
enablePullDownRefresh | true | false | No 否 | Enable pull-to-refresh 是否开启下拉刷新 | |
onReachBottomDistance | number | No 否 |
Distance from the bottom when page pull-up bottom event is triggered. The value is a non-negative integer and the unit is in px .
页面上拉触底事件触发时距页面底部距离。取值应为非负整数,单位为 px 。
|
|
orientation | string | No 否 |
Screen orientation settings, valid values: portrait and landscape .
屏幕方向设置,有效值:portrait 和landscape 。
|
|
fullscreen | true | false | No 否 | Full screen display 全屏显示 | |
designWidth | number | No 否 |
The baseline width of the page design in px , based on which the size of the components on the page would be adjusted accordingly. The value is a non-negative integer.
以px 为单位的页面设计基准宽度,元素大小将根据实际设备宽度来缩放。取值应为非负整数。
|
|
autoDesignWidth | true | false | No 否 |
Whether the designWidth of the page is auto-calculated. When it's true, the value of the designWidth is ignored, and the baseline width is determined by the system automatically according to the pixel density of the screen.
页面设计基准宽度是否自动计算,当设为true时,designWidth将会被忽略,设计基准宽度由设备宽度与屏幕密度计算得出。
|
|
reqPermissions | MiniAppPermissionResource array | No 否 | Required permissions 所需权限 | |
reqPermissions | name | string | Yes 是 | permission name 权限名称 |
reason | string | No 否 | The reason to use this permission 该权限的使用目的 |
Other WebAppManifest
members
(scope
,
theme_color
,
related_applications
,
prefer_related_applications
, and
shortcuts
) are not currently supported by MiniApp user agents.
As the application manifest is JSON, the members for this specification are of the types number, true | false literals, object, array, and string as defined in The JSON Data Interchange Format. hexcolor is a string expressing RGB color values [css-color-3] in hexadecimal notation: ‘#’ immediately followed by six hexadecimal characters (#rrggbb).
WebAppManifest
dictionarydir
member
方向
dir member, while specifying the base direction of the localizable members of the manifest, also specifies the default base text direction of the whole MiniApp. The dir member's value can be set to one of the text-direction values as specified in [appManifest].
dir member, while specifying the base direction of the localizable members of the manifest, also specifies the default base text direction of the whole MiniApp. The dir member's value can be set to one of the text-direction values as specified in [appManifest].
icons
member
图标
The icons member describes images that serve as iconic representations of MiniApps in various contexts. Both src
and sizes
are required. src
MUST be a relative-url string.
The icons member describes images that serve as iconic representations of MiniApps in various contexts. Both src
and sizes
are required. src
MUST be a relative-url string.
lang
member
语言
The lang member, while specifying the primary language of the localizable members, also specifies the primary language of the whole MiniApp.
The lang member, while specifying the primary language of the localizable members, also specifies the primary language of the whole MiniApp.
Implementers are encouraged to provide an accurate value that matches the manifest content.
name
member
名称
The name member is the descriptive name of the application. This is the name directly displayed to the user. It is used as the display name of MiniApp along with the desktop icon and in the context of MiniApp management.
name
,直接呈现给用户的名称,用于在桌面图标和MiniApp管理等处显示MiniApp的名称。
short_name
member
简称
The short_name member provides a concise and easy-to-read name for MiniApp. It can be used when there is insufficient space to display the full MiniApp name provided in name
.
short_name
,为MiniApp提供简短易读的名称,可在没有足够空间显示MiniApp名称时使用。
The members listed in this section are defined in Web App Manifest - Application Information [manifest-app-info].
description
member
简述
The description member provides a textual description for the MiniApp.
description
,为MiniApp提供简短的描述。
appID
member
标识
The appID member identifies the MiniApp univocally. This member is mainly used for the package management.
It supports the update and release of MiniApp versions.
The format of appID
SHALL be a string defined by the rule below:
appID
是MiniApp的唯一标识符,主要用于包管理,支撑MiniApp版本更新和发布。appID
的格式是由字母起头的字符串,剩余字符为数字、字母、下划线或点[a-zA-Z_\.]。一种常见的实现方式是使用类似反向域名的命名方式,如com.company.miniapp
。
appIDrule = ALPHA 1*( ALPHA / DIGIT / "_" / "." )
One common practice is to use the reverse-domain-name-like convention,
e.g. com.company.miniapp
.
One common practice is to use the reverse-domain-name-like convention,
e.g. com.company.miniapp
.
versionName
member
版本名称
The versionName member is a string-type character string that is mainly used for describing the version information. It is also the version name that is displayed to the user. The general format is "1.0.0" as specified in Semantic Versioning [SEMANTIC-VERSIONING]. It plays an important role in version control, MiniApp application, and equipment compatibility.
versionName
是一个string类型的字符串,主要用作版本信息描述,也是面向用户显示的版本名称。一般格式为:"1.0.0"
,详见定义Semantic Versioning [SEMANTIC-VERSIONING],该参数在版本控制、MiniApp应用与设备兼容性等方面发挥重要作用。
versionCode
member
版本号
The versionCode member is a number that is mainly used for enhancing the maintainability and security of MiniApp, e.g., a lower version is not compatible with a higher version. versionCode
is not displayed to the user and is incrementing according to the version iteration process. Value by default: 1.
versionCode
是一个number类型的数值,主要用作提高MiniApp的可维护性和安全性,比如:低版本不能覆盖高版本。此版本号不向用户显示,根据版本迭代过程进行递增。取值是非负整数。默认值:1
。
minPlatformVersion
member
平台版本
The minPlatformVersion member is a string-type character string that indicates the minimum supported version of the required platform to ensure the normal operation of MiniApp (e.g. "1.0.0"
).
minPlatformVersion
是一个string类型的字符串,保证MiniApp正常运行所需平台的最小支持版本。比如:"1.0.0"
。
pages
member
页面路由
The pages member is an array of relative-url string used for specifying which pages are included in a MiniApp. Each item in the array represents a page route. Page route = [path + filename]
. During the MiniApp development process, adding or deleting pages is done by configuring the array. When configuring the page route, there is no need to add the file name extension, since the MiniApp platform will automatically parse it. Note: the first item in the pages
array stands for the homepage of a MiniApp.
pages
数组用于指定MiniApp都包含哪些页面,数组中每一项代表一个页面路由,页面路由 = [路径 + 文件名]
。MiniApp开发时新增或删除页面需在数组中进行配置,配置页面路由时文件名不需加后缀名,MiniApp平台会自动解析。备注:pages
数组中第一项代表MiniApp首页。
For compatibility with the Web platform, it is RECOMMENDED to use both pages and start_url
and use the value "."
for scope
in the manifest file. The value of start_url
MUST be the same as the first entry in pages.
If scope
.
Are pages.[0]
and start_url
aligned in all cases?
window
member
窗口
The window member contains sub-attributes, defined in MiniAppWindowResource, used for styling the status bar, navigation bar, title, window background color, etc.
用于设置MiniApp的状态栏、导航条、标题和窗口背景色等样式,如下表所示:
window
inherits the text direction and language configuration from dir
and lang
.
window
的文字方向和语言设置继承自dir
和lang
.
widgets
member
卡片
The widgets member defines a set of widgets that are a part of a MiniApp.
Specifically, a MiniApp package can include MiniApp Pages and Widgets concurrently.
As a part of the MiniApp application, widgets share some of the Manifest fields with the
MiniApp main program, e.g. dir
, lang
, appID
, name
, short_name
, icons
, versionName
, and versionCode
. However, a widget also has its private fields, defined in MiniAppWidgetResource.
Widget是MiniApp的一部分。具体来说,MiniApp包中可同时包含 MiniApp Page和Widget。Widget作为MiniApp应用程序的一部分,Widget和MiniApp主体程序共用部分Manifest字段,比如:dir
、lang
、appID
、name
、short_name
、icons
、versionName
和versionCode
。但是Widget也有自己的私有字段,如下表所示:
There are certain differences between the Widget-related APIs and the MiniApp APIs, hence, the declaration of the minimum platform version may be different. If the minPlatformVersion
field of a widget is not set explicitly, it is then identical to the minPlatformVersion
of the MiniApp by default.
Widget 涉及的API与MiniApp API有一定差别,因此最小平台版本声明可能不同。如不单独设置Widget的minPlatformVersion
字段,则默认与MiniApp平台版本相同。
reqPermissions
member
所需权限
The reqPermissions member is an array of permission objects. Each MiniAppPermissionResource object declares permission (such as the access to the location information, user contacts, and hardware features like camera) required for the proper running of the MiniApp. User's consent may be asked to protect the user's privacy related to such permissions. Such information can also be used by an app store or a hosting platform to filter a MiniApp according to user's policy or device capabilities.
reqPermissions
是一个权限对象的数组,其中每个对象声明了MiniApp正常运行所需的一个权限(比如对位置信息、联系人和摄像头等硬件特性的访问)。为保护权限相关的用户隐私,可能需要征得用户同意。此类权限信息还可以被应用市场或宿主平台用来根据用户策略或者设备能力来过滤MiniApp。详细的权限对象结构定义如下表。
backgroundColor
member
The MiniAppWindowResource.backgroundColor member specifies the background color of the window. This member is equivalent to background_color
.
窗口的背景颜色
Value by default: #ffffff
.
Value by default: #ffffff
.
backgroundTextStyle
memberThe MiniAppWindowResource.backgroundTextStyle member specifies the background text style. 背景文字样式,。
Value by default: dark
.
Value by default: dark
.
enablePullDownRefresh
memberThe MiniAppWindowResource.enablePullDownRefresh member specifies if the pull-to-refresh event is enabled. 是否开启下拉刷新
Value by default: false
.
Value by default: false
.
onReachBottomDistance
member
The MiniAppWindowResource.onReachBottomDistance member specifies the distance from the bottom when page pull-up bottom event is triggered. The value is a non-negative integer and the unit is in pixel unit.
页面上拉触底事件触发时距页面底部距离。取值应为非负整数,单位为 px
。
Value by default: 50
.
Value by default: 50
.
orientation
member
The MiniAppWindowResource.orientation member specifies the screen orientation settings to which a screen can be locked. The two supported values are portrait
and landscape
, defined in OrientationLockType
[screen-orientation]. This member is equivalent to orientation
.
屏幕方向设置
Value by default: portrait
.
Value by default: portrait
.
fullscreen
member
The MiniAppWindowResource.fullscreen member indicates the full screen display. true
is equivalent to the
display
fullscreen
, and false
to minimal-ui
.
Value by default: false
.
Value by default: false
.
Should it be standalone
instead of minimal-ui
?
designWidth
member
The MiniAppWindowResource.designWidth member indicates the baseline width of the page design in pixel unit, based on which the size of the components on the page would be adjusted accordingly. The value is a non-negative integer.
以px
为单位的页面设计基准宽度,元素大小将根据实际设备宽度来缩放。取值应为非负整数。
Value by default: 750
.
Value by default: 750
.
autoDesignWidth
member
The MiniAppWindowResource.autoDesignWidth member indicates whether the designWidth of the page is auto-calculated. When it's true, the value of the designWidth
is ignored, and the baseline width is determined by the system automatically according to the pixel density of the screen.
页面设计基准宽度是否自动计算,当设为true时,designWidth将会被忽略,设计基准宽度由设备宽度与屏幕密度计算得出。
Value by default: false
.
Value by default: false
.
name
memberThe MiniAppWidgetResource.name member describes the Widget name Widget名字
path
member
The MiniAppWidgetResource.path member indicates the corresponding page path of a Widget. It follows the same path route format as defined in pages.
Widget对应页面路径,采用与pages
中相同页面路由的格式。
minPlatformVersion
memberThe MiniAppWidgetResource.minPlatformVersion member indicates the minimum platform version supported 支持最小平台版本
There are certain differences between the Widget-related APIs and the MiniApp APIs, hence, the declaration of the minimum platform version may be different. If the minPlatformVersion
field of a widget is not set explicitly, it is then identical to the minPlatformVersion
of the MiniApp by default.
Widget 涉及的API与MiniApp API有一定差别,因此最小平台版本声明可能不同。如不单独设置Widget的minPlatformVersion
字段,则默认与MiniApp平台版本相同。
name
memberThe MiniAppPermissionResource.name member indicates the permission name 权限名称
reason
memberThe MiniAppPermissionResource.reason member indicates the reason to use this permission 该权限的使用目的
It's for further study whether the predefined permissions, permission extension, permission groups, and protection levels need to be specified.
预定义权限、权限扩展、权限分组和保护等级是否需要定义有待进一步研究。
The following members are localizable and share the same default configuration of dir
and lang
if not otherwise specified.
如下属性为可本地化属性。无特别规定的情况下,共享默认的dir
和lang
配置。
To support the multiple languages, attributes such as name, short_name, and description can be set as a reference to a string resource. Typically, string resources are stored in the corresponding multi-language JSON file in the MiniApp package's i18n directory. The multi-language file’s name complies with IETF BCP 47.
为了支持多语言能力name, short_name, description等参数可以被设置为字符串资源的索引。通常情况下字符串资源被保存在MiniApp包i18n目录下相应的多语言文件中。多语言文件命名规范符合IETF BCP 47。
The following example describes two simple multi-language files:
以下例子描述2个简单的多语言文:
i18n/en-US.json
{
"strings": {
"name":"miniapp demo",
"short_name":"MD",
"description_application":"MiniApp Demo",
},
"files": {
"images":"image/en_picture.PNG",
},
}
i18n/zh-Hans.json
{
"strings": {
"name":"小程序试用版",
"short_name":"小程序",
"description_application":"迷你程序试用版本",
},
"files": {
"images":"image/zh_picture.PNG",
},
}
Developers can refer to a resource using the syntax $string:‹resource-name›, for example, "decscription": "$string:description_application".
用户可以使用$string:‹resource-name›的方式引用字符串资源,例如:"decscription": "$string:description_application".
The following example describes a simple manifest fragment that supports multiple languages capability:
以下例子描述一个简单的支持多语言的manifest片段:
{
"dir": "ltr",
"lang": "en-US",
"appID": "org.w3c.miniapp",
"name": "$string:name",
"short_name": "string:short_name",
"versionName": "1.0.0",
"versionCode": 1,
"description": "$string:description_application",
"icons": [
{
"src": "common/icons/icon.png",
"sizes": "48x48"
}
]
}
In this way, when reading the MiniApp Manifest, the MiniApp processor, such as marketplace, can extract the string resource information from the corresponding language file in the MiniApp package's i18n directory according to the configuration information of itself and generates the localized description. For example, if the configuration information of the marketplace is simplified Chinese, the marketplace parses the "name": "$string: name" statement in the manifest and extracts string: name information from the zh-Hans.json file in the MiniApp package's i18n directory. And then it generates the localized name of the MiniApp: 小程序试用版。
通过上述方式,应用市场在读取应用manifest时,会根据自身的配置信息,从i18n目录下相应的语言文件,提取字符串信息,生成本地描述。例如 应用市场配置信息为汉语简体,则应用市场会解析manifest中"name": "$string:name"语句,从i18n目录的zh-Hans.json文件,提取string:name信息:小程序试用版,并在应用市场生成该应用的本地化名称:小程序试用版。
As a key part of a MiniApp package, the manifest.json
file describes several important aspects of the MiniApp by referring to the resources inside the MiniApp package in different forms of files, such as the page files in the pages
directory and the icon images in the common
directory. Details are specified in the MiniApp Packaging specification.
作为MiniApp包中的关键部分,manifest.json
文件通过引用MiniApp包中的多个不同形式的资源文件描述了MiniApp应用的多个重要方面,比如引用pages
目录中的页面相关文件和common
目录中的图标文件。详细情况在MiniApp Packaging规范中定义。
The normal operation of a MiniApp relies on the proper configuration of the manifest file according to this specification and the availability of the dependent resources in the MiniApp package. Such dependency needs to be checked during both the development phase and deployment phase.
MiniApp的正常运行依赖于根据本规范进行恰当的manifest文件配置以及MiniApp包中所依赖资源的可用性。此依赖关系需要在开发和部署阶段进行检查。
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
本规范中的所有内容均为本草案的规范性内容,但明确标记为“非规范性”的部分、示例和注释除外。
The key word RECOMMENDED in this document is to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
如此处所示,当且仅当以着重号标记时,建议(RECOMMENDED)才以BCP 14 [RFC2119] [RFC8174]中的说明解释。
This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234].
As the manifest is a JSON file and will commonly be encoded using [UNICODE], the security considerations described in [ECMA-404] and [UTR36] apply. In order to prevent developers from including custom/unrestrained data in a manifest, implementors may use a more strict schema than that defined in JSON Schema to impose their own implementation-specific limits on the member names, types and value ranges, e.g. to guard against memory overflow, or to meet platform-specific limitations.
Manifest作为一个JSON文件,通常以[UNICODE]方式编码,因此[ECMA-404]和[UTR36]中所定义的安全措施同样适用。为了防止开发者在manifest中添加任意不受限的数据,开发者可在其具体实现中采用比JSON Schema中所定义的更加严格的schema来约束文件中的成员元素名称、类型和取值范围等,从而防止内存耗尽或满足平台特有的限制。
Members like icons
, pages
, widgets
contain paths referring to local resources on the hosting platform. Implementors and the hosting platform should check the validity of those paths to ensure no illegal access outside the scope of the MiniApp package. On the other hand, the MiniApp itself (e.g. in JS code) may provide means to jump to external resources either on the hosting platform, or on a remote web site (e.g. through a uri). In this case, the hosting platform is responsible for providing clear indication to an end-user about such context switch.
icons
, pages
, widgets
等属性包含了宿主平台上的本地资源引用路径,开发者和宿主平台应该检查这些路径的合法性以确保没有MiniApp package之外的非法访问。另一方面,MiniApp自身(如JS代码中)可能提供跳转到其他外部资源的方式,包括宿主平台或远程网站上的外部资源(比如通过uri)。此时,宿主平台应该负责向用户提供明确的上下文切换的指示信息。
In addition, the reqPermissions
member provides a specific means to control the access to the local software, hardware and data resources on the user's device. User's consent should be asked when it comes to privacy-related or high-level privileged resources.
此外,reqPermissions
属性提供了具体的控制访问用户设备上的本地软硬件及数据资源的方法。当涉及隐私或者高级权限相关的资源访问时,应该征询用户的同意。
The integrity of the manifest document is protected by a cryptographic hash mechanism as part of the whole MiniApp package. Details are specified in the MiniApp Packaging specification.
Manifest文档的完整性作为MiniApp package的一部分被密码哈希机制所保护。详细定义见MiniApp Packaging specification。
It is RECOMMENDED that the hosting platform makes the necessary meta information in the manifest available to the end-user, such as appID
, name
, short_name
, icons
, versionName
, description
. This is to give an end-user an opportunity to make a conscious decision to approve the installation and use of the MiniApp. This could also help to identify a spoofing MiniApp.
建议宿主平台将manifest中的必要元数据信息提供给用户,比如appID
, name
, short_name
, icons
, versionName
, description
。这样可以给用户一个机会来对MiniApp的安装和使用提供清晰的判断依据,也可以帮助用户来识别伪装的恶意MiniApp。
Developers interested in validating the MiniApp manifest document can use the JSON Schema defined here.
开发者可使用此处所定义的JSON Schema来验证manifest文件。
This section is non-normative.
{
"dir": "ltr",
"lang": "en-US",
"appID": "org.w3c.miniapp",
"name": "MiniApp Demo",
"short_name": "MiniApp",
"versionName": "1.0.0",
"versionCode": 1,
"description": "A Simple MiniApp Demo",
"icons": [
{
"src": "common/icons/icon.png",
"sizes": "48x48"
}
],
"minPlatformVersion": "1.0.0",
"pages": [
"pages/index/index",
"pages/detail/detail"
],
"window": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Demo",
"navigationBarBackgroundColor": "#f8f8f8",
"backgroundColor": "#ffffff",
"fullscreen": false
},
"widgets": [
{
"name": "widget",
"path": "widgets/index/index",
"minPlatformVersion": "1.0.0"
}
],
"reqPermissions": [
{
"name": "system.permission.LOCATION",
"reason": "To show user's position on the map"
},
{
"name": "system.permission.CAMERA",
"reason": "To scan the QR code"
}
]
}
This document refers to W3C Web App Manifest, Baidu MiniApp, WeChat MiniApp, Alipay MiniApp, ByteDance MiniApp, Quick App Specification, MiniApp Widget Specification, MiniApp Lifecycle Specification, MiniApp URI Scheme, and Semantic Versioning. We appreciate the open source efforts of these documents.
本文档参考了W3C Web App Manifest,百度小程序,微信小程序,支付宝小程序,字节跳动小程序,快应用联盟规范,MiniApp Widget文件规范,MiniApp Lifecycle规范,MiniApp URI规范, Semantic Versioning规范。感谢这些文档的开源努力。
This section is non-normative.
This specification is based on the Web App Manifest extensibility principle.
This specification is based on the Web App Manifest extensibility principle.
Although proprietary extensions are undesirable, they may be included as a manifest extension. In this case, it is RECOMMENDED to use vendor prefixes for the new members.
Although proprietary extensions are undesirable, they may be included as a manifest extension. In this case, it is RECOMMENDED to use vendor prefixes for the new members.
We encourage implementors to add proprietary extensions to the Extensions Registry. This allows the community to track what extensions vendors and/or the web community have defined and documented.
We encourage implementors to add proprietary extensions to the Extensions Registry. This allows the community to track what extensions vendors and/or the web community have defined and documented.
The following is an example of three hypothetical vendor extensions.
The following is an example of three hypothetical vendor extensions.
{
...
"wechat_new_feature": "foo",
"ali_new_url_system": "http://example.org",
"coolminiapp_menu_color": "#FA0000"
...
}