该下载按钮是“安装渐进式 Web 应用程序”(PWA) 按钮。它出现在具有适当元数据的网站上,以便 Chrome 将其识别为 PWA。
这是一个教程:https://tudip.com/blog-post/how-to-turn-a-website-or-web-application-into-pwa-with-example/
基本上,您需要在网站的根目录中有一个manifest.json,并且您的index.html需要在
<head>
标签中使用它:
<link rel="manifest" href="manifest.json">
清单本身应该类似于:
{
"name": "PWA-App", // installation name
"short_name": "PWA", // app title name
"start_url": ".",
"theme_color": "#4287f5",
"background_color": "#ffffff",
"display": "standalone",
"icons":[
{
"src":"images/logo192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src":"images/logo512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
Chrome 的开发工具有一个“应用程序”选项卡,如果您操作正确,就会出现该选项卡。