dismiss-cookie-banner
Skill8 starsChanged 7 months agoMITView on GitHub
Detects and dismisses cookie consent banners on any site. Use on the first interaction after navigation to any page that may show a banner.
In this repository14 other files it gives its agents.
- date-picker-widgetSkill
- detect-captchaSkill
- dismiss-newsletter-popupSkill
- exit-tracking-popupSkill
- extract-table-paginationSkill
- fill-multi-step-formSkill
- handle-infinite-scrollSkill
- handle-modal-dialogSkill
- login-flowSkill
- pagination-next-pageSkill
- searchable-dropdownSkill
- search-and-filterSkill
- upload-download-fileSkill
- verify-page-loadedSkill
The file
Files
Dismiss Cookie Banner
When to invoke
On the first interaction after navigating to a new page, before the agent attempts to interact with content. Especially relevant for sites in EU, UK, California, or Chinese jurisdictions, where banners are near-universal.
The matcher will assign this skill a high score when:
is_initial_load = truecookies_present = trueand DOM contains a cookie-related marker
Recipe
- wait_for_dom_ready timeout=2s
- wait extra=400ms
- try_each selectors=[ "#onetrust-accept-btn-handler", "button#onetrust-pc-btn-handler", ".cc-allow", ".cc-accept-all", "button.cookie-accept", "button:has-text('Accept all cookies')", "button:has-text('Accept All Cookies')", "button:has-text('Accept all')", "button:has-text('Accept cookies')", "button:has-text('I Agree')", "button:has-text('Agree and continue')", "button:has-text('Got it')", "[aria-label*='Accept' i][aria-label*='cookie' i]", "[data-testid*='cookie-banner-accept']", "[data-cookieconsent='accept']", ] action=click on_success=stop timeout=1500ms
- wait extra=300ms
Success criteria
- assert no_visible_element selector="[aria-label*='cookie' i][role='dialog']" OR no_visible_element selector="#onetrust-banner-sdk" OR no_change_was_needed
When NOT to use
- The user task is about the cookie banner itself — e.g., privacy testing, a screenshot of the pre-consent state, or auditing consent UI.
- The site has already had its banner dismissed in the persistent context (this skill is idempotent but logs an unnecessary execution).
Known failures
- Custom CMS banners (~2% of sites): sites running bespoke consent UIs may not match any of the standard selectors. The vision fallback handles these when an adapter is configured; otherwise the skill returns
failedand the agent decides. - Cross-origin iframe banners (~1%): banners served from a different origin (e.g., embedded consent providers using
<iframe>) cannot be clicked through Playwright's default context. We reportfailedwithreason="iframe_cross_origin". - "Reject all" intent: this skill always accepts. If your task requires rejecting cookies, use the future
reject-cookie-bannerskill (post-launch) or override the recipe via the agent.
Example usage
Agent: "Go to bbc.com and tell me the top story."
→ matcher selects [dismiss-cookie-banner, verify-page-loaded, extract-text]
→ invoke_skill("dismiss-cookie-banner") → success in 207ms, deterministic_path=true
→ invoke_skill("verify-page-loaded") → success in 84ms
→ agent reads the top story headline directlyRelated skills
verify-page-loaded— typically chained immediately after this onedismiss-newsletter-popup— sometimes co-occurs on news sitesexit-tracking-popup— for the rare "we use cookies for analytics" upsells that aren't the main consent UI
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

