A Chrome extension that adds a toggle button to Google Calendar, allowing you to quickly show/hide declined events by automating the native "Show declined events" setting.
π€ Built with AI: This extension was collaboratively developed with Claude Sonnet 4.5, showcasing the power of AI-assisted development for solving real workflow problems.
- β One-click toggle - Changes Google Calendar's native "Show declined events" setting
- π― Native integration - Works with Google's actual setting, not cosmetic hiding
- π¨ Seamless design - Matches Google Calendar's design language
- π Auto-sync - Syncs with manual setting changes
- πΎ Persistent - Remembers your preference across sessions and devices
- π Dark mode support - Automatically adapts to your theme
- βΏ Accessible - Keyboard navigation and screen reader support
-
Download the extension files:
manifest.jsoncontent.jsstyles.css
-
Create extension folder:
mkdir calendar-declined-toggle cd calendar-declined-toggle -
Place the three files in the folder
-
Load in Chrome:
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top-right)
- Click "Load unpacked"
- Select your extension folder
- Open Chrome and go to
Not yet published
-
Open Google Calendar at calendar.google.com
-
Find the toggle button:
- Look for "Declined Events" toggle next to the month/year dropdown
- The toggle reflects the current state of Google Calendar's native setting
-
Toggle visibility:
- Click the toggle to change the setting
- The extension opens the "Filter and view" menu, clicks the native checkbox, and closes the menu automatically
- Takes approximately 1 second to complete
- The setting persists across all your devices via Google's sync
- Page refreshes automatically to apply the change
-
Manual changes sync automatically:
- If you change the setting manually via Settings β View options β "Show declined events"
- The toggle will sync when you return to the calendar view
The extension automates Google Calendar's native "Show declined events" setting:
- Finds the "Filter and view" menu (funnel icon in the toolbar)
- Opens the menu programmatically by simulating a click
- Locates the "Show declined events" checkbox in the menu
- Clicks the checkbox if it needs to change state
- Closes the menu cleanly using Escape key and backdrop cleanup
- Syncs automatically when you return from Settings page
We evaluated multiple approaches:
-
Google Calendar API β
- The Calendar API doesn't expose "Show declined events" as a writable setting
- Would require OAuth and complex authentication
-
DOM Manipulation (v1.0) β
- Only cosmetically hides events with CSS
- Breaks when Google updates their HTML structure
- Events still load and consume resources
-
Native Menu Automation (v2.0) β (Current approach)
- Uses Google's actual setting system
- More robust than pure DOM manipulation
- Setting syncs across devices via Google
- Proper page refresh applies changes correctly
Trade-off: This approach requires ~1 second to open the menu, click the checkbox, and close it. The menu briefly flashes open, but this ensures we're using Google's official setting mechanism.
- β Minimal resource usage (only active during toggle operation)
- β ~1 second per toggle operation
- β State syncs via Chrome storage (no polling)
- β Button recreation check only every 5 seconds
- β Auto-sync detects Settings page navigation
- Refresh the page - The extension might load before Calendar is ready
- Check Developer mode - Make sure the extension is enabled in
chrome://extensions/ - Check console - Open DevTools (F12) and look for errors
This is normal! The extension needs to:
- Open the "Filter and view" menu (~200ms)
- Find and click the checkbox (~300ms)
- Close the menu cleanly (~400ms)
The brief menu flash ensures we're using Google's native setting system.
If you change the setting in Settings and the toggle doesn't update:
- Make sure you're returning to the main calendar view (not staying in Settings)
- The sync happens automatically when the URL changes from
/settingsback to calendar - Try refreshing the page if sync doesn't occur
Google may update Calendar's menu structure, breaking the extension temporarily:
- Check for extension updates - Look for a newer version
- Report the issue - Create a bug report
- Help fix it - See CONTRIBUTING.md for how to update selectors
For developers: The most common breakage points are:
- "Filter and view" button selector
- Menu item structure for "Show declined events" checkbox
- Date navigation structure for button placement
- ~1 second operation time - Opening/closing menus takes time
- Brief menu flash - You'll see the "Filter and view" menu briefly
- Requires menu automation - Depends on Google's menu structure
- Chrome only - Not compatible with Firefox/Edge (different APIs)
- No keyboard shortcut - Currently only accessible via mouse click
- Single account - Extension works with the primary Google account only (u/0)
- Menu selectors may need updating
- Toggle button placement may change
- Menu item structure may be modified
When this happens:
- Check GitHub for updates or open issues
- If no issue exists, create one
- Pull requests welcome! Fixing selector updates helps everyone
- β Google Chrome (v88+)
- β Chromium-based browsers (Edge, Brave, etc.)
- β Firefox (requires different extension format)
- β Safari (requires different extension format)
- β No data collection
- β No external network requests
- β
Only accesses
calendar.google.com - β Settings stored locally in Chrome sync storage
- β Open source - inspect the code yourself
calendar-declined-toggle/
βββ manifest.json # Extension configuration
βββ content.js # Main logic (menu automation, sync)
βββ styles.css # Toggle button styling
βββ README.md # This file
- Edit files in your extension folder
- Go to
chrome://extensions/ - Click the refresh icon on your extension
- Refresh Google Calendar to test
Open Chrome DevTools (F12) while on Google Calendar. The extension logs errors to help with debugging.
Found a bug or have an improvement?
See CONTRIBUTING.md for detailed guidelines.
Quick links:
MIT License - Feel free to modify and distribute
See LICENSE for details.
This is an unofficial extension not affiliated with Google. Google Calendar is a trademark of Google LLC.
The extension may stop working if Google updates their Calendar interface. Maintenance and updates depend on community support.
- Improved selector stability - Prioritize semantic selectors over obfuscated class names
- Added date pattern matching for button placement
- Removed unnecessary obfuscated selector fallbacks
- Optimized search performance for faster button appearance
- Filter button now uses only ARIA label (more stable)
- Complete rewrite - Now automates native "Show declined events" setting
- Added automatic sync when returning from Settings page
- Improved reliability with native menu interaction
- Better backdrop cleanup to prevent screen dimming issues
- Added error handling for Chrome extension context
- Removed all DOM manipulation and CSS hiding
- Initial release with DOM manipulation approach
- Basic show/hide functionality using CSS
- Dark mode support
- Responsive design
Issues? Questions?
- Check the Troubleshooting section above
- Inspect browser console for errors (F12)
- Open an issue on GitHub
Made with β€οΈ for productivity