A Tampermonkey userscript that adds a privacy toggle button to Google Calendar. It allows you to instantly hide all event text (titles, times, locations) while preserving the color-coded event blocks. Note that this is a vibe-coded solution which takes heavy inspiration from @IceCreamYou and others' prior work.
This is ideal for:
- Sharing your screen during meetings.
- Taking screenshots of your availability without revealing sensitive details.
- Showing someone your availability in person without revealing sensitive details.
- Floating Toggle Button: Adds a button to the bottom-left of the interface, where it is least likely to obscure something important
- Smart Hiding: Uses
color: transparentinstead of removing elements, ensuring the calendar layout (event height/width) remains exactly the same. - State Persistence: Remembers your preference (Hidden/Visible) even after reloading the page.
- Security Compliant: Includes a Trusted Types policy to work correctly with Google's strict Content Security Policy (CSP).
- Install a userscript manager like Tampermonkey or Violentmonkey.
- Click the Raw button on the
gcal-privacy-toggle.user.jsfile in this Gist. - Confirm the installation in the tab that opens.
- Refresh Google Calendar.
- Default View: Events are visible as normal.
- To Hide: Click the Eye Icon (๐๏ธ) in the bottom-left corner. It will change to a Lock Icon (๐), and all text will vanish.
- To Show: Click the Lock Icon to restore text.
The script targets the [data-eventchip] attribute, which is more stable than Google's obfuscated class names (like EiZ8Dd) which are prone to change. It injects a dynamic stylesheet that toggles based on a class added to the document body.
/* Core logic */
body.privacy-active [data-eventchip] span {
color: transparent !important;
}