Use when adding PWA capabilities, implementing a service worker, or improving the experience for users on unreliable network connections.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-offline-fallback-600a0fec61d0 ,按照其中的说明把「offline-fallback」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
The browser's default offline error screen ("No internet connection") is confusing and completely outside your brand. A custom offline page maintains the user experience, reinforces trust, and can surface cached content or useful actions — such as enabling users to continue reading a cached article or queuing a form submission for later.
Check whether the site shows a custom offline fallback page when the network is disconnected and a navigation request cannot be fulfilled.
Create a self-contained /offline page and configure the service worker to pre-cache it and serve it for failed navigation requests.
Explain how a service worker can intercept failed network requests and return a cached offline fallback page to the user.
Review the service worker fetch handler and the offline page markup. Verify the offline page is pre-cached at install time, that it does not depend on external resources, and that the fallback is only served for navigation requests (not sub-resources).
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/performance/offline-fallback