Google AI Studio | Clear Chat Button

Automates clicking chat turn options and delete buttons in Gemini.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Autore
piknockyou
Installazioni giornaliere
3
Installazioni totali
197
Valutazione
3 0 0
Versione
1.8
Creato il
03/09/2025
Aggiornato il
01/01/2026
Dimensione
12,1 KB
Licenza
AGPL-3.0
Applica a

See screenshot at the bottom

Google AI Studio | Clear Chat Button

Restores the missing clear chat button that Google removed in their August 2025 AI Studio interface revamp.

Why You Need This

Google's August 2025 AI Studio update removed the native clear chat button, making it tedious to clear conversation history:

  • Manual deletion: Must click the options menu (⋯) on each chat turn individually.
  • Multiple steps: Select delete from dropdown, then confirm for every single turn.
  • No bulk action: No way to clear all turns at once.

This script automates the entire process with a single toolbar button click.

Key Features

  • One-Click Clearing: Instantly clear all chat turns in your current prompt session.
  • Native Integration: Adds a refresh icon (🔄) to the toolbar that matches Google's Material Design.
  • SPA-Aware: Automatically re-applies the button when navigating between chats.
  • Error Handling: Robust error handling with console logging for debugging.

How to Use

Action Result
Click refresh button (🔄) Automatically clicks all option menus and delete buttons to clear the entire chat

The button appears in the top toolbar next to the "More options" (⋮) button.

Performance Notes

  • MutationObserver: Watches for toolbar changes to ensure button persists during SPA navigation.
  • Efficient targeting: Uses specific CSS selectors to only click chat turn options and delete buttons.

Installation

  1. Install Violentmonkey (recommended), Tampermonkey, or Greasemonkey.
  2. Install this script.
  3. Visit aistudio.google.com.

Works immediately. The refresh button appears in the toolbar on all prompt pages.

Technical Details

  • Automation: Sequentially clicks ms-chat-turn-options buttons, then clicks delete buttons in the menu.
  • Selectors: Configurable CSS selectors in case Google changes their DOM structure: javascript const CHAT_TURN_OPTIONS_SELECTOR = 'ms-chat-turn-options span[...]'; const DELETE_BUTTON_MENU_SELECTOR = 'div.mat-mdc-menu-content > button:first-of-type';
  • CSP Compliant: Uses DOM manipulation instead of innerHTML to avoid Content Security Policy restrictions.