Google AI Studio | Clear Chat Button

Automates clicking chat turn options and delete buttons in Gemini.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
piknockyou
Denně instalací
2
Celkem instalací
190
Hodnocení
3 0 0
Verze
1.8
Vytvořeno
03. 09. 2025
Aktualizováno
01. 01. 2026
Size
12,1 KB
Licence
AGPL-3.0
Spustit na

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.