element-hiding
它能做什么
这项技能检查网站中广告拦截器常会隐藏的名称,例如 banner 或 ad,并建议更安全的替代名称。适用于需要让重要通知保持可见的网站所有者。
适用场景
- ✓当 Cookie 提示或横幅没有出现在部分访客面前的时候。
- ✓当开启广告拦截器后,促销或通知内容消失的时候。
- ✓当你为新的页面元素选择 class 或 ID 名称的时候。
技能链接
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/element-hiding/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我检查我的 Cookie 横幅是否会被广告拦截器隐藏?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会检查 class 和 ID 名称,看它们是否符合常见广告过滤规则。对于 Cookie 同意提示等重要元素,它会建议更具体的名称。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Adblock Element Hiding
If your cookie consent banner has class .cookie-banner or ID #consent-popup, adblockers may hide it — users never see the consent notice, which can cause GDPR compliance issues and broken UX for ~30-40% of desktop users.
Quick Reference
- Adblockers use EasyList filter rules to hide elements with class names, IDs, or patterns associated with ads
- Common blocked names:
.ad,.ads,.advertisement,.banner,#ad,#ads,#banner,.sponsor - Affected elements: legitimate banners, notification bars, promotional sections, and cookie consent notices
- Test your site with uBlock Origin enabled — check for missing content, broken layouts, or hidden consent banners
- Rename affected elements using semantic, content-specific class names to avoid false-positive blocking
Check
Review the HTML source for element IDs and class names that match common adblocker patterns: .ad, .ads, .advertisement, .banner, .sponsor, #ad, #banner, .cookie-notice, .consent. Test the page with uBlock Origin enabled in a browser to identify elements that are hidden.
Fix
Rename affected elements using specific, content-focused class names that do not match adblocker patterns. For cookie consent banners specifically, use class names like .privacy-controls or .cookie-preferences instead of .cookie-banner or .gdpr-notice.
Explain
Explain how adblocker filter lists work, which HTML class names and IDs are commonly blocked, and how to rename elements to avoid false-positive blocking while maintaining their function.
Code Review
Review server config, headers, forms, and integration points related to Adblock Element Hiding. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/security/element-hiding
常见问题
为什么广告拦截器会隐藏正常内容?
它们的过滤列表会针对 ad、banner、sponsor 等名称,因此名称相似的无害元素也可能被误拦。
应该如何测试?
这项技能建议在开启 uBlock Origin 的情况下加载页面,并检查是否有内容缺失。
它会建议什么名称?
例如用 privacy-controls 或 cookie-preferences 代替 cookie-banner。
详情
作者的原始描述
Use when reviewing a website for layout and functionality issues caused by adblocker filter rules targeting common ad-related class names and IDs.
热度
- GitHub 星标
- 75k
- 排名
- #2829
- 许可证
- MIT
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
frontendchecklist
75k使用命令行工具,依据 380 多条关于无障碍、速度、SEO 和安全的规则,检查前端代码和线上页面。
frontend-checklist-global
75k依据全部 386 条 Front-End Checklist 规则审查前端项目,并为发现的每个问题给出具体修复方法。
404-page
75k检查你的页面缺失提示是否提供有用的链接,并返回真正的 404 状态,帮助迷路的访客找到方向。
about-page
75k审查你的网站是否有清晰的关于页面,说明由谁运营,以建立访客和搜索引擎的信任。