Inspiration
The modern web is plagued by intrusive cookie banners that disrupt the browsing experience and often manipulate users into consenting to extensive data tracking. This not only violates privacy but also burdens users with confusing interfaces. Inspired by the potential of in-browser AI, we sought to reimagine cookie consent as a seamless, privacy-first experience. Our goal was to empower users to regain control over their data by reducing the annoyance and deceptive patterns often embedded in these banners.
What it does
Papaya CookieMonster is a browser extension that leverages in-browser AI powered by Google's Gemini Nano to handle cookie consent banners intelligently. It scans cookie banners, identifies the key interactive elements, and automatically selects options based on user preferences, such as "Reject All" or "Manage Preferences." By utilizing Gemini Nano, CookieMonster dynamically analyzes banners, even those it hasn’t seen before, ensuring robust coverage across the web.
How we built it
Base Functionality:
We built the CookieMonster extension using JavaScript, HTML, and CSS. It uses a content script to scan web pages for cookie banners and a background script to handle logic and data persistence.
AI Integration:
Using Google's Gemini Nano in-browser AI, we added functionality to dynamically analyze unseen cookie banners. This involved:
- Crafting structured prompts to extract actionable elements (e.g., "Accept All," "Reject All").
- Cleaning banner HTML with custom preprocessing to reduce prompt size while retaining essential information.
- Parsing AI responses to identify interactive elements.
Automation:
The extension simulates user interactions, clicking buttons like "Reject All" or "Accept All" based on the user's preferences.
UX Enhancements:
Added visual feedback, like dynamic icons, to indicate when banners are processed.
Challenges we ran into
- Complex Cookie Banners: Many banners use unconventional or obfuscated HTML structures, making automated detection challenging. Integrating Gemini Nano helped overcome this by dynamically understanding new patterns.
- Prompt Optimization: Reducing the length of HTML prompts while retaining actionable content required careful cleaning and preprocessing of cookie banner elements.
- Timing Issues: Ensuring that the AI’s response was available before executing user actions required robust asynchronous handling to avoid data races.
- Performance: Balancing the computational overhead of in-browser AI with maintaining a smooth browsing experience was critical.
Accomplishments that we're proud of
- Successfully integrated Google's Gemini Nano in-browser AI to handle even unseen and complex cookie banners dynamically.
- Reduced the size of prompts sent to Gemini Nano, achieving faster and more accurate responses.
- Designed an intuitive user experience with a "set-it-and-forget-it" approach, ensuring users can browse without disruptions.
What we learned
- AI as an Enabler: In-browser AI like Gemini Nano can drastically simplify user interactions with complex web interfaces.
- Importance of Contextual Integrity: Users value privacy and control but prefer solutions that minimize their effort. CookieMonster demonstrated the importance of balancing these two factors.
- Prompt Design: Structuring concise and effective prompts is a critical skill for leveraging AI APIs efficiently.
- Resilience: Developing tools for the modern web requires handling diverse and non-standard implementations, making adaptability essential.
What's next for Papaya CookieMonster
- Enhanced AI Models: Work with Google's Gemini Nano to improve prompt accuracy and response speed.
- Payback Integration: Enable seamless integration with Papaya Payback, a feature allowing users to share and monetize their data ethically, with full control over which companies gets to access what data of theirs, and for what purposes.
- Advanced Reporting: Add a dashboard feature to provide users insights into how their data is managed and monetized.
- Wider Adoption: Collaborate with privacy advocates and organizations to make CookieMonster a standard for ethical web browsing.

Log in or sign up for Devpost to join the conversation.