首页 > 解决方案 > 如何在 GoogleSite 上添加更多支持 PWA

问题描述

这是我网站上 Lighthouse 的检查清单。(由 GoogleSite 制作)渐进式 Web 应用程序这些检查验证了渐进式 Web 应用程序的各个方面,如基线 PWA 检查表所指定的那样。

1
Does not respond with a 200 when offline
2
User will not be prompted to Install the Web App
Failures: No manifest was fetched, Site does not register a service worker.
3
Does not register a service worker
4
Is not configured for a custom splash screen
Failures: No manifest was fetched.
5
Address bar does not match brand colors
Failures: No manifest was fetched, No `<meta name="theme-color">` tag found. 

标签: progressive-web-appsgoogle-sites

解决方案


看起来您还没有创建清单或任何服务工作者:PWA 的关键引擎。因此,您没有缓存资产,并且无法在线找到它们,因此您无法获得 200 状态(一切正常,找到页面)。

从问题中,我假设一个简单的静态站点。解决此问题的最简单方法是访问https://www.pwabuilder.com,输入您的网站并复制样板代码。完成后,您将通过 Light House 休息,您的网站将离线工作并具有所有 PWA 功能。


推荐阅读