WebAPP manifest.json

Tags
webapi
Created
Jun 20, 2016 2:40 AM

https://web.dev/add-manifest

https://developer.mozilla.org/en-US/docs/Web/Manifest

If the manifest requires credentials to fetch, the crossorigin attribute must be set to use-credentials, even if the manifest file is in the same origin as the current page.

已经安装后 manifest 更新:https://web.dev/manifest-updates/

  • 请勿更改Web应用清单文件的名称或位置,否则可能会阻止浏览器更新您的PWA
  • 一天检查一次,进行比较,有更改时在所以相关窗口关闭后重新安装
  1. background_color //如启动画面背景
  2. description
  3. dir
  4. display
  5. icons 包含src,sizes(icon可以包含多个),type属性的对象 组成的数组 //128图标用于启动画面
  6. lang
  7. name
  8. orientation
  9. prefer_related_applications
  10. related_applications
  11. scope //导航超出范围返回一个正常的网页
  12. short_name
  13. start_url
  14. theme_color

https://developers.google.com/web/updates/2014/11/Support-for-installable-web-apps-with-webapp-manifest-in-chrome-38-for-Android

https://developer.mozilla.org/en-US/docs/Web/Manifest#prefer_related_applications

新字段:

  • 文件分享目标
  • 快捷菜单
  • 自定义协议
  • 处理 URL // 弃用
  • 处理文件
  • 图标遮罩
  • 截图
  • 唯一 ID
  • display-overlay: [window-control-overlay]

manifest 一旦加载就不能更改

允许使用 js 插入 manifest

允许跨域,start_ur/icon 需要使用绝对路径

不能使用 Link header

SuperMade with Super