Gemini2Markdown

Exports Google Gemini chats to Markdown. Captures "Show Thinking", auto-detects model names, loads full history, and supports dual/parallel responses.

นี่คือเวอร์ชันของสคริปต์นี้ที่โค้ดมีการอัปเดต แสดงเวอร์ชันทั้งหมด

  • v1.8.2 11-04-2026

    v1.8.2

    • Language Agnostic Button Injection: The script now targets the top-right "Upgrade" (or "Päivitä", "Tilaa Google AI Plus", etc.) button using language-agnostic DOM selectors. This ensures the Markdown button appears natively inside the pill container regardless of your Google account's interface language.
    • Visual Polish: Added the Markdown SVG icon back next to the "Markdown" text when replacing the pill button, carefully sized (20x13) and aligned to match the aesthetics of the ChatGPT-to-Markdown script.
  • v1.8.1 04-04-2026
    • Visual Update: Integrated the familiar Markdown SVG icon next to the "Markdown" text when replacing the Upgrade button, keeping the styling consistent with the ChatGPT-to-Markdown script while fully bypassing CSP blocks.
  • v1.8.0 04-04-2026

    Version 1.8.0

    • Fixed Content Security Policy (CSP) Block: Replaced all .innerHTML usage with secure DOM methods (document.createElementNS) to bypass Google's strict "Trusted Types" CSP restrictions that prevented the export button from rendering.
    • UI Selector Update: The script now cleanly hijacks the top-right "Upgrade" button (if present) to serve as the Markdown export button, preventing UI shifting and blending natively with the new Gemini layout. If the "Upgrade" button is hidden, it falls back to the conversation actions menu.
    • Improved Title Extraction: Fixed an issue where old or searched chats were incorrectly named GEMINI_Chats_...md or GEMINI_Google Gemini_...md. The script now reliably falls back to extracting the first line of the actual user prompt for the filename when native headers are missing.
    • Tampermonkey Menu Command: Added a fallback option to trigger the export directly from the Tampermonkey extension menu (GM_registerMenuCommand), ensuring you can always export even if Google drastically changes the UI.
    • Author Note: Updated script authorship.
  • v1.7.0 30-03-2026

    Icon fixed again

  • v1.6.9 14-03-2026

    v1.6.9

    • Dual Response Support: Added support for parallel response drafts (<dual-model-response>). If Gemini generates two side-by-side answers, the script now exports both, clearly labeling them (e.g., "Draft 1", "Draft 2") and separating them with a horizontal rule.
    • Tampermonkey Menu Fallback: Added "Export to Markdown" to the Tampermonkey extension menu (GM_registerMenuCommand) as a reliable fallback if the UI button fails to render.
    • UI Improvements: Added z-index: 1000 to the export button to prevent it from being hidden beneath other UI elements, and improved click event handling (preventDefault, stopPropagation).
    • Metadata Update: Switched to the official Gemini favicon (@icon).
  • v1.6.8 14-03-2026

    v1.6.8

    • Tampermonkey Menu Fallback: Added a fallback "📥 Export Chat to Markdown" command to the Tampermonkey extension menu (GM_registerMenuCommand) in case the UI button fails to inject.
    • UI Selector Updates: Expanded DOM selectors (e.g., catching h1 for titles, .mat-menu-item for model detection, and new button containers) to adapt to the latest Gemini UI changes.
    • Stability & Timing: Slightly increased interaction delays (sleep timings) to make "Show Thinking" expansion and model extraction more reliable on slower connections.
    • HTML Escaping: Updated the text cleaner to safely escape HTML brackets (< to &lt;, > to &gt;) to prevent raw tags from breaking Markdown rendering.
    • Robustness: Wrapped the button injection in a try...catch block and added z-index: 1000 to ensure the UI button is always visible and doesn't crash the script if DOM elements are missing.
  • v1.6.7 18-02-2026

    Icon fix

  • v1.6.6 12-01-2026

    Added icon.

  • v1.6.5 11-01-2026

    Adjusted icon position with 3px top margin to perfectly align the 15px SVG baseline with the New Chat icon.

  • v1.5.7 10-01-2026