Google AI Studio | Chat MarkDown-Export

Export AI Studio conversations to Markdown with intelligent mode detection, toolbar integration, and abortable processing. Features dual-mode extraction and configurable filters.

作者
piknockyou
日安装量
1
总安装量
5
评分
1 0 0
版本
2.4
创建于
2025-11-02
更新于
2025-11-02
大小
61.4 KB
许可证
MIT
适用于

Google AI Studio | Chat MarkDown-Export

Export Google AI Studio chats to Markdown: auto-detects Raw/Rendered modes, abortable scrolling, configurable filters (user/AI/thinking). Toolbar-integrated for quick capture and archiving.

Features

  • Intelligent Mode Detection: Automatically detects Raw Mode vs Rendered Mode and adapts extraction strategy accordingly
  • Abortable Processing: Cancel extraction mid-process with the click of a button for responsive user experience
  • Toolbar Integration: Seamlessly integrated into AI Studio's existing toolbar with native Material Design styling
  • Configurable Export Filters: Real-time control over what content to include in exports (user messages, AI responses, AI thinking)
  • High-Performance Scrolling: Ultra-fast scrolling with 50ms delays and intelligent batching for maximum speed
  • Auto-Recovery: Automatically handles dynamic UI re-rendering and maintains functionality across navigation
  • Dual-Mode Support: Works with both Raw Mode (clean markdown) and Rendered Mode (formatted content)
  • CSP-Compliant: Fully compliant with AI Studio's Content Security Policy restrictions
  • Advanced Content Extraction: Captures user prompts, AI responses, and AI thinking/reasoning processes
  • Visual State Feedback: Button shows current status (Idle/Working/Success/Error) with appropriate Material Design icons

Installation

Requirements

Steps

  1. Install one of the userscript managers listed above
  2. Download the script file
  3. Import the script into your userscript manager
  4. The script will automatically activate on https://aistudio.google.com/*

Usage

  1. Navigate to any conversation page in Google AI Studio
  2. Look for the export/download icon in the top toolbar
  3. (Optional) Click the settings gear icon to configure export filters:
    • Toggle Raw Mode preference
    • Include/exclude user messages
    • Include/exclude AI responses
    • Include/exclude AI thinking/reasoning
  4. Click the export button to begin automated capture
  5. Monitor progress via button state changes (working → success/error)
  6. Click the button again during processing to abort if needed
  7. Download starts automatically when extraction is complete

How It Works

The script automates the complete conversation export process:

  1. Mode Detection: Automatically detects current page mode (Raw vs Rendered)
  2. Mode Toggle (if needed): Switches to preferred mode for optimal extraction
  3. High-Speed Scrolling: Performs ultra-fast automated scrolling through the entire conversation
  4. Smart Content Extraction: Captures user prompts, AI responses, and thinking processes in real-time
  5. Expandable Sections: Automatically expands collapsed thinking/reasoning sections before extraction
  6. Final Verification: Performs multiple collection passes to ensure complete capture
  7. Markdown Generation: Formats captured content into clean, structured Markdown
  8. File Download: Automatically downloads the formatted export file

This entire process is reduced to a single button click in the toolbar.

Configuration

The script includes runtime-configurable settings accessible via the settings panel:

// Core preferences
let PREFER_RAW_MODE = true;           // Auto-switch to Raw Mode for cleaner extraction
let INCLUDE_USER_MESSAGES = true;     // Include user prompts in export
let INCLUDE_AI_RESPONSES = true;      // Include AI answers in export
let INCLUDE_AI_THINKING = false;      // Include AI reasoning/thought process

Credits & Inspiration

This script builds upon concepts from two projects:

  1. Userscript: Google AI Studio 聊天记录导出器 (now deleted)

  2. Extension: Gemini to PDF