Inspiration
Across the U.S., countless like people parents, students, and coworkers are blindsided by disturbing visuals while doing totally normal things: homework, checking the news, or queuing up music on YouTube. Traditional blockers are either sledgehammers (over-blocking everything) or sieves (missing obvious risks), and most ship sensitive data to the cloud. We set out to build a gentle, empathetic, privacy-first guardian that works even offline and adapts to each person’s reality especially Americans who report being triggered by drugs and alcohol imagery, violence and abuse, and body-image cues. If someone’s personal trigger is spiders, money, or a specific food, they can add it, so the web blurs the right things for them, not for an average user who doesn’t exist.
What it does
What Guardian Angel Does
Chrome extension, plug-and-protect - install from chrome://extensions (load unpacked) and it starts guarding visuals across Google, YouTube, Instagram, and X/Twitter. Blurs risky visuals instantly - images and video thumbnails across Google, YouTube, Instagram, X/Twitter, and more, whenever selected categories or your custom triggers are detected. Understands your words, any language - custom triggers are multilingual and breed/species aware (e.g., “cats” also matches gato, 猫, кошка, Siamese, Persian). Private by design, works offline - no required network calls. A fast on-device heuristic + dictionaries handle protection; when available, Gemini Nano (Prompt API) and Chrome’s Translator/Language Detector API enhance accuracy still fully local. Smart precision, fewer false positives - site-aware tuning avoids over-blocking trusted sources (like Wikipedia) and ignores clearly non-risky YouTube music content. Human-centered controls - one-tap **Reveal, optional text scanning for captions/blogs, and simple toggles for violence, abuse, body-image, cigarettes, alcohol, drugs, mental-health, and more plus your own custom lists.
How we built it
Core Pieces Content script that watches the DOM for img and video thumbnails and applies a gentle blur overlay with a “Reveal” action. AI integration layer that: -Uses Gemini Nano Prompt API (if present) for pixel-level image understanding and to expand custom terms (synonyms, breeds/species). -Uses Chrome Translator API + Language Detector (if present) to normalize titles/alt text/queries across languages so triggers work globally. -Falls back to local multilingual dictionaries, synonym lists, and a heuristic risk scorer so the extension works 100% offline when APIs aren’t available. -Service worker for settings (categories on/off, text-scanning option, custom triggers, reveal behavior). -Popup UI for quick toggles and adding customs. -Privacy: Data never leaves the device. Matching is local; optional AI runs on-device (Gemini Nano). No cloud calls.
Heuristic Scoring
- When on-device AI is unavailable, we combine textual signals into a simple risk score: -Extract context (𝐶): page title, query terms, ALT/TITLE/ARIA attributes, nearby captions.
- Normalize (C) using local dictionaries/romanization to pseudo-English tokens.
Architecture (High-Level)
- content_script.js -observes media nodes, queries the AI layer, applies overlay blur + Reveal. utils/ai_integration.js
- assessVisual() → tries Prompt API for pixel-level JSON decision; if unavailable, falls back to contextual heuristic with Translator API + Language Detector and dictionaries.
- assessText()→ optional (off by default); long blocks only (blogs/captions).
- prepareCustom() → expands user customs to multilingual and breed/species variants (Prompt API when present; static dictionaries otherwise).
- service_worker.js - settings and message routing.
- popup - UI, category toggles, custom entries, text-scanning on/off.
Why Gemini Nano & Chrome AI APIs -Prompt API (Gemini Nano): on-device image understanding and smarter expansion of customs no data leaves the device. -Translator API + Language Detector: robust cross-language trigger detection; if unavailable, we fall back to embedded dictionaries.
Challenges we ran into
-False positives vs. misses: Early versions blurred unrelated content (e.g., YouTube music). We added host-aware priors and title heuristics to reduce noise. -Mixed content & CORS: Many thumbnails blocked when fetched over HTTP from HTTPS pages. We upgraded to HTTPS mirrors (e.g., i.ytimg.com) and added canvas fallbacks.
- CSP restrictions: Removed inline scripts; everything loads as modules to keep the extension CSP-safe.
- Multilingual breadth: Building static dictionaries that feel “good enough” offline took iteration; we combined curated lists + on-device expansion for breadth.
Accomplishments that we're proud of
-Truly offline fallback that remains useful and accurate across languages. -Gentle UX: empathetic overlays, single-click reveal, optional text scanning. -Scalable custom triggers: from “cats” to breeds in multiple languages with one input.
What we learned
On-device Chrome AI changed the game for us. With Gemini Nano (Prompt API) available, pixel-level judgments and custom-trigger expansion happen fast, privately, and without any cloud trade-offs users actually feel the difference. But we also learned that AI isn’t a silver bullet: a clear heuristic model with host-aware priors and language normalization still carries the experience when Chrome AI isn’t present. Building a great extension is its own craft CSP-safe code, resilient service workers, file:// permissions, and cross-origin media quirks can make or break reliability.
What's next for Guardian Angel
We’re making Guardian Angel feel even more yours. You’ll be able to teach it in a few examples like show 3–5 images and it will learn a private, on-device trigger that never leaves your laptop. We’re adding an adaptive safety slider and per-site sensitivity, so search pages can be stricter while trusted sites stay open and useful. Our multilingual packs will grow (animals, foods, currency, slang), and we’ll sample video frames more intelligently for sharper thumbnail decisions. Day-to-day polish : better keyboard and screen-reader support, easy export/import of profiles, and hardened selectors for YouTube, Instagram, and X backed by automated tests. And when Chrome AI / Gemini Nano is available, we’ll lean in smarter synonym discovery and context-aware filtering running entirely on-device so protection feels quiet, accurate, and always private.
Built With
- css
- gemini
- html
- javascript
- nano
- prompt-api
- translator-api
Log in or sign up for Devpost to join the conversation.