A Chrome extension that highlights Gmail message rows based on user-defined rules. You can highlight emails by sender, subject, or label criteria with custom background colors.
- Flexible Rule Matching: Create rules to match emails by:
- Sender (email address or name)
- Subject line
- Sender or Subject (matches if pattern appears in either field)
- Gmail labels
- OR Pattern Matching: Use comma-separated patterns for OR logic (e.g.,
googledev,GDG,Google Cloud) - Custom Colors: Choose any background color for each rule
- Edit Rules: Modify rule type, pattern, or color after creation
- Edit Colors: Click any color swatch to quickly change a rule's color
- Real-time Updates: Rules apply immediately without page reload
- Enable/Disable Rules: Toggle rules on and off without deleting them
- Privacy-Focused: All data stored locally, no external servers
- Open Chrome and navigate to
chrome://extensions/ - Enable Developer mode (toggle in the top-right corner)
- Click "Load unpacked"
- Select the
highlight-gmaildirectory - The extension is now installed!
- Right-click the extension icon in Chrome's toolbar
- Select "Options" (or go to
chrome://extensions/→ find "Gmail Row Highlighter" → click "Options") - Fill out the form:
- Rule Type: Choose from:
- "Sender Contains" - matches sender email or name
- "Subject Contains" - matches subject line
- "Sender or Subject Contains" - matches if pattern appears in either field
- "Label Contains" - matches Gmail labels
- Pattern: Enter the text to match (e.g.,
@client.com,Contract:,NIAID)- OR Matching: Use commas to match multiple patterns (e.g.,
googledev,GDG,Google Cloud)
- OR Matching: Use commas to match multiple patterns (e.g.,
- Background Color: Pick a color for matching emails
- Rule Type: Choose from:
- Click "Add Rule"
- Open Gmail and see your emails highlighted!
-
Highlight emails from a specific domain:
- Type: Sender Contains
- Pattern:
@client.com
-
Highlight emails with specific subject keywords:
- Type: Subject Contains
- Pattern:
Contract
-
Highlight emails with a specific label:
- Type: Label Contains
- Pattern:
Important
-
Highlight emails matching multiple patterns (OR logic):
- Type: Sender or Subject Contains
- Pattern:
googledev,googlecloud@google.com,GDG,Google Developer Program - Matches emails containing any of these terms
- Edit: Click the "Edit" button to modify a rule's type, pattern, or color
- Edit Color: Click the color swatch next to any rule to quickly change its color
- Disable/Enable: Click the "Disable" or "Enable" button next to any rule
- Delete: Click the "Delete" button to remove a rule permanently
- Rules are saved automatically - no need to click a "Save" button
- The extension injects a content script into Gmail pages
- It observes the Gmail message list using a MutationObserver
- When new emails load or rules change, it checks each email row against your rules
- The first matching rule applies its background color to the row
- Matching is case-insensitive by default
- OR Pattern Matching: Comma-separated patterns are split and checked individually (any match triggers the rule)
- Each comma-separated term is matched as a complete phrase (e.g., "Google Cloud" matches the full phrase, not just "Google")
- Manifest Version: 3
- Storage: Uses Chrome's sync storage (rules sync across devices)
- Permissions: Only requires
storagepermission - Privacy: All processing happens locally in your browser
- Make sure you're on
mail.google.com - Check that your rules are enabled (not grayed out)
- Verify the pattern matches the email content (case-insensitive)
- Try refreshing the Gmail page
- Check Chrome's storage quota (extensions → Gmail Row Highlighter → Details)
- Ensure you're not in incognito mode (extensions may be disabled)
- Check the browser console for errors (F12 → Console)
- Reload the extension in
chrome://extensions/ - Refresh the Gmail page
- Check the browser console for error messages
highlight-gmail/
├── manifest.json # Extension configuration
├── content-script.js # Main highlighting logic
├── styles.css # Highlight styles
├── options.html # Options page UI
├── options.js # Options page logic
├── icons/ # Extension icons
└── README.md # This file
- Make changes to the source files
- Go to
chrome://extensions/ - Click the refresh icon on the extension card
- Refresh your Gmail tab to see changes
This project is open source. Feel free to modify and distribute.
- Regular expression pattern support
- Rule priority/ordering
- Export/import rules as JSON
- Extension popup with quick toggle
- Preset rule templates
- Case-sensitive matching option
- AND logic for multiple patterns (currently supports OR via comma-separated patterns)