Inspiration
Inspiration
We've all been there — zoning out mid-email, slowing down on a cover letter, losing momentum on something important. Most productivity tools reward you for finishing. We wanted to build something that punishes you for slowing down. Inspired by the Stupid Ideas Hackathon spirit, we asked: what if your text editor had zero patience?
Type Trap was born.
What it does
Type Trap is a Chrome Extension that monitors your typing speed in real time across any text field on any website — Gmail, Twitter, Google Docs, Reddit, anywhere.
If your WPM drops below your set threshold:
- A red warning banner slams down from the top of the screen
- Your text starts deleting itself — faster the slower you type
- Gemini AI generates a savage, personalized roast based on both your speed AND what you're actually writing about
The slower you type, the more characters disappear. There is no mercy.
How we built it
Type Trap is built as a Manifest V3 Chrome Extension with three core components:
content.js — Injected into every webpage, this script tracks keystrokes using keydown event listeners, calculates WPM using a rolling 10-second timestamp window, triggers deletion via execCommand for contenteditable elements (Gmail, Docs) and direct .value manipulation for standard inputs, and injects warning overlays directly onto the page DOM.
background.js — A service worker that handles Gemini API calls. When WPM drops below threshold, content.js sends the current WPM and the last 10 words typed to background.js via Chrome message passing. Background.js calls the Gemini 2.0 Flash API with a prompt engineered to produce specific, brutal one-liner roasts.
popup.html/js — A dark-themed settings dashboard where users set their WPM threshold, toggle the trap on/off, and paste their Gemini API key. Settings persist via chrome.storage.sync.
Challenges we ran into
The biggest challenge was cross-site compatibility. Standard input event listeners don't work on Gmail or Twitter because they use contenteditable divs instead of native <textarea> elements. We had to switch to keydown capture with DOM tree traversal to detect typing targets, and use execCommand('delete') for deletion across contenteditable environments.
Chrome's extension context invalidation also caused early headaches — reloading the extension while tabs were open broke the message passing channel between content.js and background.js.
Accomplishments that we're proud of
The Gemini integration ended up being more creative than we expected. Rather than generic speed roasts, Gemini reads what you're actually writing and roasts the content alongside the speed. Getting roasted for writing a slow cover letter hits different than a generic "type faster" message.
What we learned
Chrome Extension architecture — specifically how content scripts, service workers, and message passing work together. The difference between host_permissions and permissions in Manifest V3. How modern web apps like Gmail and Google Docs bypass native browser input elements entirely, and how to work around that.
What's next for Type Trap
- Full Google Docs support via keyboard event interception
- Customizable deletion aggression levels
- A leaderboard of the most brutal Gemini roasts generated
- Voice mode — Gemini reads the roast out loud