meta-refresh
它能做什么
这项技能找出使用自动 meta refresh 进行跳转或重新加载的页面,并用更好的方案替换它们。适用于希望页面可预测、更易访问的开发者。
适用场景
- ✓当你请智能体检查页面是否存在自动跳转或刷新的时候。
- ✓当用户反映页面在没有提示的情况下重新加载或跳转到其他地址的时候。
- ✓当你迁移仍使用 meta refresh 标签把访客带到其他地方的旧页面的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/meta-refresh/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的一些旧页面使用 meta refresh 标签跳转。请帮我换成正规的重定向。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在 HTML 中搜索会自动刷新页面的 meta 标签。然后它会建议使用服务器端重定向,或提供一个由用户决定是否点击的清晰链接。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Avoid meta refresh redirects
Unexpected page refreshes or redirects can be extremely confusing for users with cognitive disabilities and can cause screen readers to restart reading from the beginning.
Quick Reference
- Avoid using
<meta http-equiv="refresh">for page redirects - Use server-side redirects (301 or 302) instead of client-side meta refreshes
- Ensure users have control over page refreshes and redirects
Check
Check the HTML for any meta tags that use http-equiv="refresh" for automatic page redirection.
Fix
Replace meta refresh redirects with server-side redirects or clear, user-initiated links.
Explain
Explain why automatic page refreshes can be a major barrier for accessibility and user experience.
Code Review
Review the rendered markup and interactive states that affect Avoid meta refresh redirects. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/meta-refresh
常见问题
为什么自动刷新是个问题?
它可能会让有认知障碍的用户感到困惑,也可能使屏幕阅读器从头开始朗读。
应该使用 301 还是 302 重定向?
这项技能提到使用 301 或 302 状态码的服务器端重定向作为替代方案。
如果应该由用户决定何时跳转呢?
那么这项技能建议使用由用户点击激活的清晰链接,而不是自动跳转。
详情
作者的原始描述
Use when reviewing rendered HTML, interactive components, or design-system patterns related to Avoid meta refresh redirects. Check native semantics first, then inspect keyboard behavior, focus flow, accessible names, and screen-reader output where relevant.
热度
- GitHub 星标
- 75k
- 排名
- #2936
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。