A Chrome extension to filter Substack notifications based on keywords, engagement, and other criteria.
This is a starter template that provides the basic structure. It needs customization based on Substack's actual DOM structure.
- ✅ Extension manifest (V3)
- ✅ Content script with filtering logic framework
- ✅ Settings popup interface
- ✅ Basic styling
⚠️ Placeholder DOM selectors (need to be customized)
Before the extension will work, you need to:
- Go to https://substack.com/notifications
- Open Chrome DevTools (F12)
- Inspect notification elements
- Document the actual selectors for:
- Notification container
- Individual notification items
- Username/author
- Comment text
- Like count
- Notification type
In content.js, replace the TODO placeholders:
// Line ~75: Find notification elements
const notificationElements = document.querySelectorAll('[ACTUAL-SELECTOR]');
// Line ~120: Extract username
const usernameElement = element.querySelector('[ACTUAL-USERNAME-SELECTOR]');
// Line ~126: Extract like count
const likeElement = element.querySelector('[ACTUAL-LIKE-SELECTOR]');Load the extension in Chrome and test:
- Does it detect notifications?
- Does filtering work correctly?
- Does the UI show up properly?
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (top right toggle)
- Click "Load unpacked"
- Select the
substack-extension-starterfolder - Navigate to https://substack.com/notifications
- Open DevTools console to see debug logs
The extension references icon files that don't exist yet. You need to create:
icons/
icon16.png (16x16)
icon48.png (48x48)
icon128.png (128x128)
For now, you can use any placeholder images or remove the icon references from manifest.json.
- ✅ Keyword/slur blacklist
- ✅ Minimum likes threshold
- ✅ Follow status (manual user list management)
- ✅ Filter statistics display
- ✅ Toggle to show/hide filtered notifications
- ✅ Settings popup with configuration
- ✅ Visual distinction for filtered items
- ✅ Chrome storage sync
- ✅ Mutation observer for dynamic content
- ✅ Message passing between popup and content script
substack-extension-starter/
├── manifest.json # Extension configuration
├── content.js # Main filtering logic (runs on Substack)
├── styles.css # UI styling
├── popup.html # Settings interface
├── popup.js # Settings logic
├── icons/ # (needs to be created)
│ ├── icon16.png
│ ├── icon48.png
│ └── icon128.png
└── README.md # This file
Recommended approach:
-
Inspect Substack
# Open browser to Substack notifications # Document selectors in a file
-
Update selectors in content.js
# Use Claude Code to edit content.js with real selectors claude code edit content.js -
Test
# Reload extension in Chrome # Check console for errors # Verify filtering works
-
Iterate
- Fix bugs
- Improve selectors
- Add features
- Refine UI
Settings available in the popup (click extension icon):
- Enable/disable filtering: Master toggle
- Blocked keywords: One per line, case-insensitive
- Minimum likes: Filter notifications below this threshold
- Only show from followed users: Enable to hide notifications from users not in your followed list
- Followed users list: Manually add usernames (one per line, without @ symbol)
- Follow status requires manual management - Users must manually add usernames to the followed list
- No icon files - Will show default extension icon
- Substack might change their structure - Will require maintenance if DOM classes change
Check the console logs:
- Content script logs: Open page, press F12, go to Console
- Background/popup logs: Go to chrome://extensions, click "service worker" or "Inspect popup"
Common issues:
- "No notifications found" → Wrong selectors
- "Config not loading" → Storage permission issue
- "UI not appearing" → Wrong container selector
- ✅ Research complete (see main research doc)
- ✅ Customize DOM selectors
- ✅ Add follow status detection
- 🔄 YOU ARE HERE → Test extension functionality
- ⏳ Create icon files
- ⏳ Polish UI/UX
- ⏳ Add advanced features
This is a development template. For issues:
- Check browser console for errors
- Verify Substack hasn't changed their structure
- Update selectors as needed
This template is provided as-is for development purposes.