💻 StackOverflow Déjà Vu - Chrome Extension Code
Track visited StackOverflow URLs and get notified when you revisit the same problem.
// manifest.json
{
"manifest_version": 3,
"name": "StackOverflow Déjà Vu",
"version": "1.0",
"description": "Tracks visited StackOverflow URLs and alerts on revisits",
"permissions": ["storage", "alarms"],
"host_permissions": ["*://stackoverflow.com/*"],
"background": {
"service_worker": "background.js"
},
"content_scripts": [
{
"matches": ["*://stackoverflow.com/*"],
"js": ["content.js"]
}
]
}
// background.js
let visitedUrls = new Set();
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.type === 'STACKOVERFLOW_VISIT') {
const url = message.url;
if (visitedUrls.has(url)) {
chrome.notifications.create({
type: 'basic',
iconUrl: 'icon.png',
title: 'StackOverflow Déjà Vu!',
message: `You've visited this solution before. Maybe write it down this time?`
});
} else {
visitedUrls.add(url);
chrome.storage.local.set({ visitedUrls: Array.from(visitedUrls) });
}
}
});
// Load saved URLs on startup
chrome.storage.local.get(['visitedUrls'], (result) => {
if (result.visitedUrls) {
visitedUrls = new Set(result.visitedUrls);
}
});
// content.js
if (window.location.hostname.includes('stackoverflow.com')) {
chrome.runtime.sendMessage({
type: 'STACKOVERFLOW_VISIT',
url: window.location.href
});
}
The Problem: You're Basically a Goldfish with a Mechanical Keyboard
Let's be honest: your brain has exactly two modes when it comes to error messages. Mode 1: "I've never seen this before in my life, time to panic-search StackOverflow for three hours." Mode 2: "This looks familiar... vaguely... like a dream I had once... better search StackOverflow for three hours just in case."
The absurdity is palpable. You've solved the "Cannot read property 'map' of undefined" error approximately 47 times in your career. You've copy-pasted the same Docker port mapping solution from StackOverflow so many times that the Ctrl+C and Ctrl+V keys on your keyboard have developed a romantic relationship. Yet here you are, staring at the same error, with the same sinking feeling, about to embark on the same Google journey that ends at the same StackOverflow answer you've visited before.
Why does this happen? Because developer memory works like a cache with an absurdly short TTL. You solve a problem, feel triumphant for approximately 3.2 seconds, then immediately flush that knowledge to make room for remembering whether you left the stove on. Your browser history? That's just a graveyard of forgotten solutions, a digital attic so cluttered you'd rather search the entire internet again than dig through it.
The Solution: A Sarcastic Memory for Your Forgetful Brain
I built StackOverflow Déjà Vu to solve this embarrassing cycle of developer amnesia. It's a browser extension that does what your brain refuses to: remember things. Specifically, it remembers every StackOverflow URL you visit, timestamps them, and—here's the magic part—actually uses that information later.
When you inevitably search for "TypeError: Cannot set property 'innerHTML' of null" for the seventh time this month, StackOverflow Déjà Vu quietly checks its database, finds your previous visits to identical or similar problems, and presents them to you with the gentle, loving sarcasm you deserve. No more digging through browser history. No more pretending you'll remember the search terms that worked last time. Just cold, hard data about your own forgetfulness, delivered with a side of snark.
The beauty is in its simplicity. It doesn't try to solve your problems for you—you still need to actually read the solutions. It just eliminates the hours of redundant searching that stand between you and the answer you already found last week. Think of it as a personal assistant who's seen you make the same mistake enough times that they've earned the right to be a little judgy about it.
How to Use It: Installing Your Digital Conscience
Getting started is easier than remembering your own solutions. Clone the repository, load it as an unpacked extension in Chrome or Firefox, and suddenly you have a memory that extends beyond your last coffee break.
The extension works silently in the background, building its database of your StackOverflow visits. When you land on a StackOverflow page, it logs the URL and timestamp. When you search for error messages or problems, it compares your search terms against previously visited pages and shows matches. The interface is intentionally minimal—because the real magic happens when you're about to waste time and it intervenes.
Here's a taste of the main logic that makes it work:
// The core detection logic (simplified)
function detectDejaVu(searchTerm, visitedUrls) {
const normalizedSearch = normalizeSearchTerm(searchTerm);
return visitedUrls.filter(url => {
const pageContent = getCachedPageContent(url);
const similarity = calculateSimilarity(normalizedSearch, pageContent);
// If it looks suspiciously similar to something you've seen before
return similarity > SIMILARITY_THRESHOLD;
}).sort((a, b) => b.timestamp - a.timestamp); // Most recent first
}
// The gentle reminder you deserve
function generateReminder(matches) {
const daysAgo = Math.floor((Date.now() - matches[0].timestamp) / (1000 * 60 * 60 * 24));
return `You visited ${matches.length} similar solutions ` +
`(${daysAgo} day${daysAgo === 1 ? '' : 's'} ago). ` +
`Maybe check your browser history? Just a thought.`;
}Check out the full source code on GitHub to see the complete implementation, including the similarity detection algorithms and storage mechanisms.
Key Features: Your Personal Shame Tracker
- Tracks StackOverflow URLs you've visited with timestamps: Every visit, every time. It remembers what you forget.
- Detects when you're searching for similar error messages: Uses text similarity algorithms to find patterns in your forgetfulness.
- Generates sarcastic reminders: "You solved this exact problem 3 days ago" is just the beginning. Wait until you see the messages for problems you've solved 10+ times.
- Local storage only: Your browsing data stays on your machine. The only thing shared is your shame with yourself.
- Open source and customizable: Don't like the tone? Change the reminder messages to be even more brutal. You deserve it.
Conclusion: Break the Cycle, Embrace the Shame
StackOverflow Déjà Vu won't make you smarter. It won't improve your memory. It won't even prevent you from making the same mistakes. What it will do is cut the time between realizing you have a problem and finding the solution you already discovered last week. It's efficiency through humiliation, and it works.
The tool is available right now at https://github.com/BoopyCode/stackoverflow-deja-vu-1767494286. Install it. Use it. Let it gently mock you every time you forget what you already know. Your future self—the one who just saved 45 minutes of redundant searching—will thank you.
Remember: the first step to solving developer amnesia is admitting you have it. The second step is installing a tool that points it out every single time.
Quick Summary
- What: A browser extension that tracks your StackOverflow visits and sarcastically reminds you when you're searching for problems you've already solved.
💬 Discussion
Add a Comment